EventManager never unreferences SettingsManagers from Preferences

Bug #377755 reported by Abhishek Mukherjee
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Exaile
Fix Released
High
Unassigned

Bug Description

When a preference panel is opened, the prefs panel makes a clone of the current SettingsManager for a scratch pad. When the window is closed, these clones are never freed. The reason for this is because each SettingsManager instance adds an event to EventManager: every 30 seconds the SettingsManager should be saved. This will hold the reference to the clone alive indefinately causing (eventually) a memory leak. There are a few possible solutions to this:
* Weak reference event manager - an object can add a function and, in the event manager, only a weak reference will be kept. This seems to be the best if not just for completeness in the event manager.
* SettingsManagers will not add a tick event if there is no location to save to (clones will have their 'loc' property set to None)
* dereference events explicitly, OK and Cancel callbacks for the preference pane will call a destroy() on settings as necessary.

Steps to reproduce:
1. check out trunk -r 1868
2. apply attached patch
3. run exaile in terminal
4. while bored or not satisfied:
  i. open preferences
  ii. close preferences
5. note in the console saves are still being called for preference panes 1..n (0 is the main one for exaile)

Revision history for this message
Abhishek Mukherjee (linkinpark342) wrote :
description: updated
Revision history for this message
reacocard (reacocard) wrote :

we really should make the event system use weakrefs instead of normal refs, then things like this couldn't happen.

Changed in exaile:
importance: Undecided → High
milestone: none → 0.3.0
status: New → Confirmed
Revision history for this message
reacocard (reacocard) wrote :

fixed a while ago

Changed in exaile:
status: Confirmed → Fix Committed
reacocard (reacocard)
Changed in exaile:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.