Commit 7638d411 authored by Daniel Trebbien's avatar Daniel Trebbien Committed by Paolo Borelli

Fix possible memory leak

In treeview_selection_changed(), if `notebook` is not NULL, then it needs
to be unrefed.

See:  http://developer.gnome.org/gtk/unstable/GtkTreeModel.html#gtk-tree-model-get

https://bugzilla.gnome.org/show_bug.cgi?id=669913
parent 412df6b6
......@@ -617,9 +617,11 @@ treeview_selection_changed (GtkTreeSelection *selection,
{
gedit_multi_notebook_set_active_tab (panel->priv->mnb,
tab);
if (notebook != NULL)
g_object_unref (notebook);
g_object_unref (tab);
}
else
else if (notebook != NULL)
{
panel->priv->setting_active_notebook = TRUE;
gtk_widget_grab_focus (GTK_WIDGET (notebook));
......@@ -633,6 +635,8 @@ treeview_selection_changed (GtkTreeSelection *selection,
G_CALLBACK (document_changed),
panel);
}
g_object_unref (notebook);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment