summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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: