Codebase list glib-d / fd11e03
Only use toggle references for GObjects that hold a reterence to a D object. Mike Wey 5 years ago
1 changed file(s) with 6 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
461461 isGcRoot = false;
462462 }
463463
464 g_object_remove_toggle_ref(gObject, cast(GToggleNotify)&toggleNotify, cast(void*)this);
464 // We only have a toggle ref if the C object hods a reference to the D object.
465 if ( g_object_get_data(gObject, cast(char*)"GObject") is cast(void*)this )
466 g_object_remove_toggle_ref(gObject, cast(GToggleNotify)&toggleNotify, cast(void*)this);
467 else
468 g_object_unref(gObject);
465469 }
466470 }
467471
592596 p[0..ci.initializer.length] = ci.initializer;
593597 iface = cast(Impl)p;
594598 iface.gObject = instance;
595 iface.addToggleRef(cast(GToggleNotify)&toggleNotify, cast(void*)iface);
599 iface.doref();
596600
597601 return iface;
598602 }