Indicator objects are not being disposed (and the dispose method is broken)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Indicator Applet |
Fix Released
|
High
|
Ted Gould |
Bug Description
When an indicator object is instantiated, it has a reference count of 2. This is because it is incremented once in the gobject init function, and once in indicate_
The indicators in the Pidgin plugin are not being disposed of for this reason, since only one unref is called in the IM focus callback.
If a programmer hackishly brought the ref count to zero (by unreffing twice), the indicator would run into an unref in the dispose function, because it calls indicate_
My proposal would be to remove the ref/unref from the server add/hide functions. Their GTK+ equivalents do ref/unref, but in our case the server is singleton, and the adding/removing is done implicitly anyway.
This also raises a semi-related API question: Should the add/remove be in the public API? It seems to me that since the server is singleton there is no need for this. All that is probably needed is a destroy() of some sorts for explicit removal. But hide() and a proper GC would do too.
Related branches
Changed in indicator-applet: | |
importance: | Undecided → High |
milestone: | none → 0.1.5 |
status: | New → Confirmed |
Changed in indicator-applet: | |
status: | Fix Committed → Fix Released |
I committed the patch. I want to leave the functions in the API just for people who are perhaps building their own indicator subclasses. There's really no way to do 'friends' in GObject that way. Thanks for the patch! Good catch!