node-gtk
node-gtk copied to clipboard
fix(gobject, value): fix GObject never being released
- Makes sure that AssociateGObject() takes 1 reference for the object, not 2. g_object_ref_sink() does give you a ref, so if we add a toggle ref, we must release the recently-sunken one.
- Calls g_object_remove_toggle_ref() instead of g_object_unref() in GObjectDestroyed(). Otherwise, object's dispose vfunc could cause ToggleNotify() to be called again while disposing.
- If the function returns a ref to GObject, make sure to release it, as the JS wrapper takes its own reference.
macOS failure might be related to https://github.com/nodejs/node-gyp/issues/2869. Downgrading Python might help.