summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2012-03-31 16:57:45 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2012-03-31 16:57:45 +0200
commit4535d3e2bbee2c2d07674323a746e008ebbe9bd3 (patch)
tree3a0daa8809bbcd9c2d12cdc8b268ccf9a23efade
parenteae6365a39a924b42546846b9edc16850167a0dd (diff)
downloadcv-4535d3e2bbee2c2d07674323a746e008ebbe9bd3.tar.gz
cv-4535d3e2bbee2c2d07674323a746e008ebbe9bd3.tar.bz2
cv-4535d3e2bbee2c2d07674323a746e008ebbe9bd3.zip
roi: Dont try to unref modification if nothing is modified
-rw-r--r--roi.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/roi.c b/roi.c
index 9a3d078..266cb15 100644
--- a/roi.c
+++ b/roi.c
@@ -177,9 +177,11 @@ key_event(GtkWidget *widget, GdkEventKey *event, gpointer userdata)
switch (event->keyval) {
case GDK_KEY_d:
case GDK_KEY_D:
- g_object_unref(roi->modified_input);
- roi->modified_input = NULL;
- gtk_widget_queue_draw(roi->drawing_area);
+ if (roi->modified_input) {
+ g_object_unref(roi->modified_input);
+ roi->modified_input = NULL;
+ gtk_widget_queue_draw(roi->drawing_area);
+ }
break;
case GDK_KEY_q:
case GDK_KEY_Q: