[ekiga] RosterViewGtk: Explicitely unselect all when removing a Heap.
- From: Damien Sandras <dsandras src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga] RosterViewGtk: Explicitely unselect all when removing a Heap.
- Date: Thu, 22 Jan 2015 07:59:59 +0000 (UTC)
commit e5b19a8e679959446711272f49a0b1c1782bddc2
Author: Damien Sandras <dsandras seconix com>
Date: Sun Jan 18 11:43:37 2015 +0100
RosterViewGtk: Explicitely unselect all when removing a Heap.
This could avoid a crash due to dangling references.
lib/engine/gui/gtk-frontend/roster-view-gtk.cpp | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp b/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp
index 274e0ec..3390d0d 100644
--- a/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp
+++ b/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp
@@ -1078,9 +1078,12 @@ on_heap_removed (RosterViewGtk* self,
GtkTreeIter heap_iter;
GtkTreeIter group_iter;
guint timeout = 0;
+ GtkTreeSelection* selection = gtk_tree_view_get_selection (self->priv->tree_view);
roster_view_gtk_find_iter_for_heap (self, heap, &heap_iter);
+ gtk_tree_selection_unselect_all (selection);
+
// Remove all timeout-based effects for the heap presentities
if (gtk_tree_model_iter_nth_child (GTK_TREE_MODEL (self->priv->store),
&group_iter, &heap_iter, 0)) {
@@ -1489,8 +1492,10 @@ roster_view_gtk_update_groups (RosterViewGtk *view,
(GCompareFunc) g_ascii_strcasecmp);
path = gtk_tree_model_get_path (model, heap_iter);
- gtk_tree_view_expand_row (view->priv->tree_view, path, FALSE);
- gtk_tree_path_free (path);
+ if (path) {
+ gtk_tree_view_expand_row (view->priv->tree_view, path, FALSE);
+ gtk_tree_path_free (path);
+ }
path = gtk_tree_model_get_path (model, &iter);
if (path) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]