diff options
-rw-r--r-- | roi.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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: |