diff --git a/src/flash.c b/src/flash.c index 11e3107..bced587 100644 --- a/src/flash.c +++ b/src/flash.c @@ -60,7 +60,7 @@ dbus_brightness_init(GObject *src, GAsyncResult *res, gpointer *user_data) if (!dbus_brightness_proxy || err) { printf("Failed to connect to dbus brightness service %s\n", err->message); - g_object_unref(err); + g_error_free(err); return; } } @@ -145,7 +145,7 @@ brightness_received(GDBusProxy *proxy, GAsyncResult *res, gpointer user_data) if (!result) { printf("Failed to get display brightness: %s\n", error->message); - g_object_unref(error); + g_error_free(error); return; } diff --git a/src/main.c b/src/main.c index 5dbf6ba..b293090 100644 --- a/src/main.c +++ b/src/main.c @@ -500,6 +500,7 @@ run_open_last_action(GSimpleAction *action, GVariant *param, gpointer user_data) g_printerr("Could not launch image viewer for '%s': %s\n", uri, error->message); + g_error_free(error); } } @@ -511,6 +512,7 @@ run_open_photos_action(GSimpleAction *action, GVariant *param, gpointer user_dat sprintf(uri, "file://%s", g_get_user_special_dir(G_USER_DIRECTORY_PICTURES)); if (!g_app_info_launch_default_for_uri(uri, NULL, &error)) { g_printerr("Could not launch image viewer: %s\n", error->message); + g_error_free(error); } } @@ -577,6 +579,7 @@ on_zbar_dialog_response(GtkDialog *dialog, int response, char *data) if (!g_app_info_launch_default_for_uri(data, NULL, &error)) { g_printerr("Could not launch application: %s\n", error->message); + g_error_free(error); } case GTK_RESPONSE_ACCEPT: { GdkDisplay *display = gtk_widget_get_display(GTK_WIDGET(dialog)); @@ -927,7 +930,7 @@ display_config_received(GDBusConnection *conn, GAsyncResult *res, gpointer user_ if (!result) { printf("Failed to get display configuration: %s\n", error->message); - g_object_unref(error); + g_error_free(error); return; } diff --git a/src/process_pipeline.c b/src/process_pipeline.c index 95a031c..d62e2ba 100644 --- a/src/process_pipeline.c +++ b/src/process_pipeline.c @@ -609,6 +609,7 @@ process_capture_burst(GdkTexture *thumb) if (!proc) { g_printerr("Failed to spawn postprocess process: %s\n", error->message); + g_error_free(error); return; }