Bug 3162 - Finalised GObjects not unregistered from the bus
Summary: Finalised GObjects not unregistered from the bus
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Havoc Pennington
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-29 09:24 UTC by Ross Burton
Modified: 2006-08-01 10:26 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Add a weak reference to unregister the object (1.91 KB, patch)
2005-04-29 09:26 UTC, Ross Burton
Details | Splinter Review
Ditto, using quarks (1.69 KB, patch)
2005-04-29 09:34 UTC, Ross Burton
Details | Splinter Review
Improved patch (1.53 KB, patch)
2005-05-02 09:24 UTC, Ross Burton
Details | Splinter Review

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.