node-gtk icon indicating copy to clipboard operation
node-gtk copied to clipboard

fix(gobject, value): fix GObject never being released

Open peat-psuwit opened this issue 1 year ago • 1 comments

  • 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.

peat-psuwit avatar Nov 12 '23 18:11 peat-psuwit

macOS failure might be related to https://github.com/nodejs/node-gyp/issues/2869. Downgrading Python might help.

peat-psuwit avatar Nov 12 '23 20:11 peat-psuwit