[Bug 797322] New: Callback being made on a garbage collected delegate of PromiseChangeFuncNative

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Mon Oct 22 20:06:35 UTC 2018


https://bugzilla.gnome.org/show_bug.cgi?id=797322

            Bug ID: 797322
           Summary: Callback being made on a garbage collected delegate of
                    PromiseChangeFuncNative
    Classification: Platform
           Product: GStreamer
           Version: 1.14.x
                OS: Windows
            Status: NEW
          Severity: major
          Priority: Normal
         Component: gst-sharp
          Assignee: gstreamer-bugs at lists.freedesktop.org
          Reporter: krzys95 at gmail.com
        QA Contact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---

Created attachment 374005
  --> https://bugzilla.gnome.org/attachment.cgi?id=374005&action=edit
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.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list