Commit b38f70c6 authored by Mike Wey's avatar Mike Wey

Also check if the toggle ref is conected to the corect ObjectG

instance.

This fixes a warning printed to stderr about a missing toggle ref, and a
possible memory leak.

We may want to check  the actual toggle ref data instead of assuming we
have the correct instence if the "gObject" data equals this.
parent 5159ff74
......@@ -303,7 +303,11 @@ public class ObjectG
{
enum TOGGLE_REF_FLAG = 0x1;
return (g_datalist_get_flags(&gObject.qdata) & TOGGLE_REF_FLAG) != 0;
if ( (g_datalist_get_flags(&gObject.qdata) & TOGGLE_REF_FLAG) != 0 )
//TODO: Assumes we always have the gObject data set if the toggleRef is connected to this instance.
return (g_object_get_data(gObject, cast(char*)"GObject") is cast(void*)this);
else
return false;
}
public void removeGcRoot()
......
......@@ -597,7 +597,11 @@ code: start
{
enum TOGGLE_REF_FLAG = 0x1;
return (g_datalist_get_flags(&gObject.qdata) & TOGGLE_REF_FLAG) != 0;
if ( (g_datalist_get_flags(&gObject.qdata) & TOGGLE_REF_FLAG) != 0 )
//TODO: Assumes we always have the gObject data set if the toggleRef is connected to this instance.
return (g_object_get_data(gObject, cast(char*)"GObject") is cast(void*)this);
else
return false;
}
public void removeGcRoot()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment