Improve reference counting in the history panel
This does not fully solve it but should avoid warnings caused by invalid objects.
This commit is contained in:
parent
5bf2662bad
commit
f95254cd04
1 changed files with 2 additions and 4 deletions
|
@ -293,7 +293,7 @@ midori_history_disconnect_folder (MidoriHistory* history,
|
||||||
while ((item = katze_array_get_nth_item (array, i++)))
|
while ((item = katze_array_get_nth_item (array, i++)))
|
||||||
{
|
{
|
||||||
if (KATZE_IS_ARRAY (item))
|
if (KATZE_IS_ARRAY (item))
|
||||||
midori_history_disconnect_folder (history, KATZE_ARRAY (item), TRUE);
|
midori_history_disconnect_folder (history, KATZE_ARRAY (item), unref);
|
||||||
if (unref)
|
if (unref)
|
||||||
g_object_unref (item);
|
g_object_unref (item);
|
||||||
}
|
}
|
||||||
|
@ -461,7 +461,6 @@ midori_history_insert_item (MidoriHistory* history,
|
||||||
age = day - pday;
|
age = day - pday;
|
||||||
gtk_tree_store_insert_with_values (treestore, &iter, parent,
|
gtk_tree_store_insert_with_values (treestore, &iter, parent,
|
||||||
0, 0, item, 1, age, -1);
|
0, 0, item, 1, age, -1);
|
||||||
g_object_unref (item);
|
|
||||||
piter = &iter;
|
piter = &iter;
|
||||||
}
|
}
|
||||||
i = 0;
|
i = 0;
|
||||||
|
@ -501,7 +500,7 @@ midori_history_set_app (MidoriHistory* history,
|
||||||
|
|
||||||
model = gtk_tree_view_get_model (GTK_TREE_VIEW (history->treeview));
|
model = gtk_tree_view_get_model (GTK_TREE_VIEW (history->treeview));
|
||||||
midori_history_insert_item (history, GTK_TREE_STORE (model),
|
midori_history_insert_item (history, GTK_TREE_STORE (model),
|
||||||
NULL, KATZE_ITEM (g_object_ref (history->array)), day);
|
NULL, KATZE_ITEM (history->array), day);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -973,7 +972,6 @@ midori_history_finalize (GObject* object)
|
||||||
/* FIXME: We don't unref items (last argument is FALSE) because
|
/* FIXME: We don't unref items (last argument is FALSE) because
|
||||||
our reference counting is incorrect. */
|
our reference counting is incorrect. */
|
||||||
midori_history_disconnect_folder (history, history->array, FALSE);
|
midori_history_disconnect_folder (history, history->array, FALSE);
|
||||||
|
|
||||||
g_object_unref (history->array);
|
g_object_unref (history->array);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue