mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-08 18:39:54 +00:00
MiniObject: fix MakeWritable In case the MiniObject had a reference count of 1 (writable), the object was destroyed due to a bug in Opaque not handling self-assignment of Raw. In case the MiniObject was not writable, the returned copy was not writable either because it had two references: one from gst_mini_object_make_writable and one from Opaque.Raw.
This commit is contained in:
parent
20a3d2a22d
commit
cff0582d61
1 changed files with 6 additions and 3 deletions
|
@ -46,9 +46,12 @@ namespace Gst {
|
|||
static extern IntPtr gst_mini_object_make_writable(IntPtr mini_object);
|
||||
|
||||
public void MakeWritable() {
|
||||
Console.WriteLine (Handle);
|
||||
Raw = gst_mini_object_make_writable (Raw);
|
||||
Console.WriteLine (Handle);
|
||||
IntPtr raw = gst_mini_object_make_writable (Raw);
|
||||
if (raw == Raw)
|
||||
return;
|
||||
Raw = raw;
|
||||
if (raw != IntPtr.Zero)
|
||||
Unref (raw);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue