Fix finalizers implementation for Opaque subclasses#55
Conversation
3c4fe0c to
05839f6
Compare
|
I don't have a the correct set-up to re-generate all the sources. I would need someone with the latest sources of all deps to correctly regenerate the bindings. |
There was one finalizer being called for each level of inheritance. For example Gst.Message -> Gst.MiniObject -> GLib.Opaque ends with 2 finalizers being called, one calling gst_mini_object_unref and another one calling gst_message_unref The following implementation will only call once the unref function for the highest class in the hierarchy Fixes GLibSharp#54
38ef8ba to
61b0b33
Compare
|
Everything is ready from my side now and the PR is ready for review |
|
Have you written a patch for gst-sharp already? |
|
I am still setting up the dev env from scratch in macOS, once done I will create a patch for gstreamer-sharp and run the unit tests I have for module using it, which is what triggered the issues with the finalizers. |
|
Should we wait for the GSTreamer patches to be ready/tested first? |
|
I have been able to test the patch with GStreamer 1.18.0 and everything works correctly now without glib warnings nor crashes. |
|
I created the following MR in gstreamer-sharp for 1.18 https://gitlab.freedesktop.org/gstreamer/gstreamer-sharp/-/merge_requests/30 |
There was one finalizer being for level of inheritance.
For example Gst.Message -> Gst.MiniObject -> GLib.Opaque ends
with 2 finalizers being called, one calling gst_mini_object_unreg
another one calling gst_message_unref
The following implementation will only call once the unref function
for the highest class in the hierarchy
Fixes #54