A series of fixed memory problems



Hi there,

o. Uncaching the folder when a new folder is selected, is no longer nec-
essary. The TnyMsgHeaderListModel GtkTreeModel type is now, by itself,
smart about when to do that.

o. This one in the demo-ui, which was originally put there to avoid an
embarrassing crash ;) when replacing the model of a view with a new
model that shares the same header proxy instances (so basically an ex-
treme locking issue between destroying and creating the exact same inst-
ances in an aggressive test), has since the TnyListIface and iterator
concepts been fixed.

I tested the code and this is, indeed, working perfectly. I'm keeping
the line in tact because it's indeed not necessary to reload the folder
if the last folder is same as the new folder. It would just cause an
unnecessary flood of destruction and construction of exactly the same
proxy instances. But it does, however, work.

static void
on_mailbox_view_tree_selection_changed (GtkTreeSelection *selection, 
		gpointer user_data)
{
...
		if (priv->last_folder == folder)
			return;
...
}


o. Removing an account from gconf-editor now correctly clears *all* mem-
ory used by that account. The mistake was in tny-summary-window.c, in
the reload_accounts method: it didn't take the real model out of the
sort model to destroy it. 

Another method would be to remove one reference after parenting the real
model in the sort model. But parenting the real model (which is a Tny-
MsgHeaderListModel instance) in a GtkTreeModelSort, adds a reference.

Switching the model in a GtkTreeView only removes that extra reference.
Not the original reference created when the TnyMsgHeaderListModel con-
struction happened.

So when building a ui where it's possible to remove accounts and sup-
porting sorting using a parent-model, make sure you correctly clear or
reparent the GtkTreeModel instances.


-- 
Philip Van Hoof, software developer at x-tend 
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
work: vanhoof at x-tend dot be 
http://www.pvanhoof.be - http://www.x-tend.be




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]