GNOME Bugzilla – Bug 730410
serviceproxy: service_proxy_add_notify shouldn't have (scope async)
Last modified: 2014-05-20 06:38:11 UTC
I've been having some trouble in Vala, where calling service_proxy.add_notify(..) was causing my object to be unreffed every time it got called. My Vala code looks like this: // ... service.add_notify("UIListingUpdate", typeof(string), handle_ui_listing_update); // ... void handle_ui_listing_update(GUPnP.ServiceProxy service) { service.begin_action("GetCompatibleUIs", handle_compatible_uis, /* in */ "InputDeviceProfile", typeof(string), "", "UIFilter", typeof(string), "", null); } And this is the C code it generated for the callback: // ... gupnp_service_proxy_add_notify (_tmp1_, "UIListingUpdate", G_TYPE_STRING, _rui_discoverer_handle_ui_listing_update_gu_pn_pservice_proxy_notify_callback, rui_discoverer_ref (self)); // ... static void _rui_discoverer_handle_ui_listing_update_gu_pn_pservice_proxy_notify_callback (GUPnPServiceProxy* proxy, const gchar* variable, GValue* value, gpointer self) { rui_discoverer_handle_ui_listing_update (self, proxy); rui_discoverer_unref (self); } It looks like scope = async makes it assume that the function is only called once, and the input data should be unrefed after that. Removing (scope async) from add_notify in gupnp-1.0.vapi fixed this. I tried removing it from the annotation in gupnp_service_proxy.c, but then I get: Warning: GUPnP: gupnp_service_proxy_add_notify: argument callback: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async) So presumably the real fix is more complicated than this.
Yeah, that's already known and more or less fixed, needs to be pushed (I forgot, sorry) *** This bug has been marked as a duplicate of bug 701446 ***