aboutsummaryrefslogtreecommitdiff
path: root/libqmenumodel
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2013-07-25 12:52:23 +0200
committerLars Uebernickel <lars.uebernickel@canonical.com>2013-07-25 12:52:23 +0200
commit58afcb80014d14ab95a031e19bdc11664c8a1d5b (patch)
treea105248f8fc7ffd24e878936b8b24259effd38b6 /libqmenumodel
parent57f5b0730a9f001201458d2759797bba17cabaef (diff)
downloadqmenumodel-58afcb80014d14ab95a031e19bdc11664c8a1d5b.tar.gz
qmenumodel-58afcb80014d14ab95a031e19bdc11664c8a1d5b.tar.bz2
qmenumodel-58afcb80014d14ab95a031e19bdc11664c8a1d5b.zip
Fix crash in UnityMenuModel::menuItemChanged
menuItemInserted set the iter _after_ the one that was just inserted as qdata. This is (a) wrong and (b) leads to the end iter being in there in some cases. menuItemChanged can't deal with that (it calls g_sequence_get() without checking for the end iter).
Diffstat (limited to 'libqmenumodel')
-rw-r--r--libqmenumodel/src/unitymenumodel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libqmenumodel/src/unitymenumodel.cpp b/libqmenumodel/src/unitymenumodel.cpp
index 0fc5612..418de61 100644
--- a/libqmenumodel/src/unitymenumodel.cpp
+++ b/libqmenumodel/src/unitymenumodel.cpp
@@ -187,9 +187,9 @@ void UnityMenuModelPrivate::menuItemInserted(GtkMenuTrackerItem *item, gint posi
priv->model->beginInsertRows(QModelIndex(), position, position);
it = g_sequence_get_iter_at_pos (priv->items, position);
+ it = g_sequence_insert_before (it, g_object_ref (item));
g_object_set_qdata (G_OBJECT (item), unity_menu_item_iterator_quark (), it);
g_signal_connect (item, "notify", G_CALLBACK (menuItemChanged), it);
- g_sequence_insert_before (it, g_object_ref (item));
priv->model->endInsertRows();
}