[gimp] Bug 682585 - Edit/Modules: pressing any key crashes gimp
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Bug 682585 - Edit/Modules: pressing any key crashes gimp
- Date: Sun, 14 Oct 2012 13:30:51 +0000 (UTC)
commit 20279d6fd6df8fe024f0f740e4da7cae84f85d1d
Author: Michael Natterer <mitch gimp org>
Date: Sun Oct 14 15:29:23 2012 +0200
Bug 682585 - Edit/Modules: pressing any key crashes gimp
Don't crash if module-dialog.c: dialog_select_callback() is called
without any selected list item.
app/dialogs/module-dialog.c | 25 ++++++++++++++-----------
1 files changed, 14 insertions(+), 11 deletions(-)
---
diff --git a/app/dialogs/module-dialog.c b/app/dialogs/module-dialog.c
index c4e494d..bd3af71 100644
--- a/app/dialogs/module-dialog.c
+++ b/app/dialogs/module-dialog.c
@@ -282,22 +282,25 @@ static void
dialog_select_callback (GtkTreeSelection *sel,
ModuleDialog *dialog)
{
- GimpModule *module;
- GtkTreeIter iter;
+ GtkTreeIter iter;
- gtk_tree_selection_get_selected (sel, NULL, &iter);
- gtk_tree_model_get (GTK_TREE_MODEL (dialog->list), &iter,
- COLUMN_MODULE, &module, -1);
+ if (gtk_tree_selection_get_selected (sel, NULL, &iter))
+ {
+ GimpModule *module;
- if (module)
- g_object_unref (module);
+ gtk_tree_model_get (GTK_TREE_MODEL (dialog->list), &iter,
+ COLUMN_MODULE, &module, -1);
- if (dialog->selected == module)
- return;
+ if (module)
+ g_object_unref (module);
- dialog->selected = module;
+ if (dialog->selected == module)
+ return;
- dialog_info_update (dialog->gimp->module_db, dialog->selected, dialog);
+ dialog->selected = module;
+
+ dialog_info_update (dialog->gimp->module_db, dialog->selected, dialog);
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]