Comment 4 for bug 704829

Revision history for this message
Krzysztof Kościuszkiewicz (k-kosciuszkiewicz) wrote : Call sequence leading to segfault

It seems the situation unfolds as follows:
 * refresh button triggers compselect_callback_refresh_library
 * compselect->libtreeview model is updated first
 * update triggers compselect_callback_tree_selection_changed
 * callback checks the selection update came from library view
 * "buffer" property is correctly set to NULL
 * x_compselect_callback_response is triggered
 * "symbol" property is read
 * compselect_get_property doesn't check where the selection came from
 * in use tree view is queried for selection
 * stale pointer is returned and passed to o_complex_prepare_place

One solution I can think of is to block "changed" GtkTreeSelection event
handlers while updating the GtkTreeViews with new models.
I have tested this and it works, but maybe someone has a cleaner fix...

A memory leak is plugged in the second patch.