Releasing context menu items ?



Hi guys,

It appeared to me yesterday (or very soon this morning ;-)) that 
(at least) context menu items created by a menu provider extension
are only released when changing current folder, not when changing 
the selection, and, when releasing, only those corresponding to the
latest selection are, not those for previous selections.

Does someone may confirm this ?

I've seen this because I use to attach an object to each context 
menu item I create in Nautilus-Actions, using 
g_object_weak_ref( menu_item, my_function, my_object) to release it.
It appears that the 'my_function' notify function is only called 
when the current folder changes, and only for the last objects I 
attached (i.e. the objects I attached when creating context menu
items for the last selection before the current folder changes)

As I create context menu items each time I'm triggered by 
'get_file_items' menu provider interface, the behavior I describe
above leads to many memory leaks :(

I don't yet have taken the time to go through Nautilus code, but
I should be able to provide a minimal plugin which exhibits this
if needed.

Also, I didn't want open a Nautilus bug before someone in this list
may have add some comment to that.

Regards
Pierre


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