After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 797322 - Callback being made on a garbage collected delegate of PromiseChangeFuncNative
Callback being made on a garbage collected delegate of PromiseChangeFuncNative
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-sharp
1.14.x
Other Windows
: Normal major
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-10-22 20:06 UTC by Krzysztof Z
Modified: 2018-11-03 11:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Code I'm basing on (10.78 KB, text/plain)
2018-10-22 20:06 UTC, Krzysztof Z
Details

Description Krzysztof Z 2018-10-22 20:06:35 UTC
Created attachment 374005 [details]
Code I'm basing on

I'm using a slightly modified version of Centriculars WebRTCSendRecv example. When debugging, about 2/3 of the times, I'm getting the following exception:

'CallbackOnCollectedDelegate' : 'A callback was made on a garbage collected 
delegate of type 'gstreamer-sharp!GstSharp.PromiseChangeFuncNative::Invoke'. 
This may cause application crashes, corruption and data loss. When passing 
delegates to unmanaged code, they must be kept alive by the managed 
application until it is guaranteed that they will never be called.'

It happens exactly when OnOfferCreated should be called back, but as I said, it doesn't happen every time. It might be that specificity of my code causes that GC sometimes kicks in at a specific moment (?).

I think I'm safe to assume that it is not my mistake because keeping a handle to PromiseChangeFuncNative should be done by PromiseChangeFuncWrapper class after I provide PromiseChangeFunc delegate. What I understand should happen here is PersistUntilCalled() should be called somewhere but it is not.

I'm attaching the code that I'm basing on (from their github). I haven't modified OnNegotiationNeeded and OnOfferCreated methods at all, other parts are only slightly modified to get data from custom appsrc but I am unable to provide the exact code.
Comment 1 GStreamer system administrator 2018-11-03 11:09:32 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gstreamer-sharp/issues/9.