diff --git a/src/mn-text-table.gob b/src/mn-text-table.gob index b5f6cb5..6751d7e 100644 --- a/src/mn-text-table.gob +++ b/src/mn-text-table.gob @@ -90,14 +90,17 @@ class MN:Text:Table from Mn:Widget row_free (Row *row (check null)) { mn_g_ptr_array_free_deep_custom(row->cells, (GFunc) self_cell_free, NULL); + row->cells = NULL; g_free(row); } private void cell_free (MNTextTableCell *cell (check null)) { - if (cell->layout) + if (cell->layout) { g_object_unref(cell->layout); + cell->layout = NULL; + } g_free(cell); } diff --git a/src/mn-tooltips.gob b/src/mn-tooltips.gob index 2f9da32..b01c4d7 100644 --- a/src/mn-tooltips.gob +++ b/src/mn-tooltips.gob @@ -88,17 +88,18 @@ class MN:Tooltips from G:Object GSList *data_list_copy; GSList *l; - if (selfp->timeout_id) + if (selfp->timeout_id) { g_source_remove(selfp->timeout_id); + selfp->timeout_id = 0; + } - /* Create a copy of the list to avoid memory corruption as the - * self_widget_remove call removes the item from selfp->data_list */ - data_list_copy = g_slist_copy(selfp->data_list); - MN_LIST_FOREACH(l, data_list_copy) - { - TooltipsData *data = l->data; - self_widget_remove(data->widget, data); - } + /* Create a copy of the list to avoid memory corruption as the + * self_widget_remove call removes the item from selfp->data_list */ + data_list_copy = g_slist_copy(selfp->data_list); + MN_LIST_FOREACH(l, data_list_copy) { + TooltipsData *data = l->data; + self_widget_remove(data->widget, data); + } g_slist_free(data_list_copy); self_unset_window(self); @@ -115,7 +116,9 @@ class MN:Tooltips from G:Object g_object_set_data(G_OBJECT(data->widget), TOOLTIPS_DATA, NULL); g_object_unref(data->widget); + data->widget = NULL; g_object_unref(data->tip_widget); + data->tip_widget = NULL; g_free(data); } @@ -139,11 +142,11 @@ class MN:Tooltips from G:Object private void unset_window (self) { - if (selfp->window) - { - self_disconnect_display_closed(self); - gtk_widget_destroy(selfp->window); - } + if (selfp->window) { + self_disconnect_display_closed(self); + gtk_widget_destroy(selfp->window); + selfp->window = NULL; + } } private void