Bug 3162

Summary: Finalised GObjects not unregistered from the bus
Product: dbus Reporter: Ross Burton <ross>
Component: coreAssignee: Havoc Pennington <hp>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high    
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Add a weak reference to unregister the object
Ditto, using quarks
Improved patch

Description Ross Burton 2005-04-29 09:24:08 UTC
If I register a GObject on the bus, and the object is finalised, it is not
unregistered from the bus.

Attaching patch to fix this.
Comment 1 Ross Burton 2005-04-29 09:26:51 UTC
Created attachment 2594 [details] [review]
Add a weak reference to unregister the object

Just realised a possible alternative to the struct would be to store the path
in the GObject using g_object_set_(q)data.
Comment 2 Ross Burton 2005-04-29 09:34:44 UTC
Created attachment 2595 [details] [review]
Ditto, using quarks

I've never really used g_object_set_qdata but it seems to work.
Comment 3 Havoc Pennington 2005-04-29 14:38:45 UTC
Looks plausible to me, but should check with Colin since this is his stuff and
he said he had outstanding changes.

I think quarks are usually a pointless optimization but that's just a generalization
Comment 4 Ross Burton 2005-05-02 09:24:06 UTC
Created attachment 2608 [details] [review]
Improved patch

This patch doens't use quarks directly but lets GObject do the conversion from
strings, and in the callback steals the path from the object and frees it
directly.
Comment 5 Colin Walters 2005-05-03 10:45:45 UTC
Applied, thanks!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.