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:
Master T 2014-09-18 04:59:33 +02:00 committed by Stephan Sundermann
parent 20a3d2a22d
commit cff0582d61

View file

@ -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);
}
}
}