diff --git a/src/control/control.c b/src/control/control.c index 0016da147d4e..544fe045d202 100644 --- a/src/control/control.c +++ b/src/control/control.c @@ -324,7 +324,12 @@ void dt_control_set_temp_cursor(const char *cursor_name) void dt_control_clear_temp_cursor() { GdkWindow *window = gtk_widget_get_window(dt_ui_main_window(darktable.gui->ui)); - if(!_prev_cursor) return; + if(!_prev_cursor) + { + if(window) + gdk_window_set_cursor(window, NULL); + return; + } if(window) gdk_window_set_cursor(window, _prev_cursor); g_object_unref(_prev_cursor); diff --git a/src/develop/develop.c b/src/develop/develop.c index 89296ba62fcb..27390197f503 100644 --- a/src/develop/develop.c +++ b/src/develop/develop.c @@ -3526,7 +3526,7 @@ dt_iop_module_t *dt_dev_module_duplicate_ext(dt_develop_t *dev, dt_iop_module_t *module = calloc(1, sizeof(dt_iop_module_t)); if(dt_iop_load_module(module, base->so, base->dev)) { - free(module); + // failed module already freed while failing to load return NULL; } module->instance = base->instance;