Fix incorrectly freeing GError

This commit is contained in:
Benjamin Schaaf 2021-11-16 23:22:32 +11:00
parent 3fb5eef160
commit c277342f74
3 changed files with 7 additions and 3 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}