summaryrefslogtreecommitdiff
path: root/settings
diff options
context:
space:
mode:
authorTheo Linkspfeifer <lastonestanding@tutanota.com>2019-06-16 23:59:07 +0200
committerSimon Steinbeiss <simon.steinbeiss@elfenbeinturm.at>2019-06-17 00:00:53 +0200
commit5f7d120c9646beeb0bcfad2b306f8f3ce81752ad (patch)
tree8c9ba998318c57006c266257704aa0cce842d588 /settings
parenta81bdec069fd6184eab3818b54bfd646fa3f08be (diff)
downloadxfce4-session-5f7d120c9646beeb0bcfad2b306f8f3ce81752ad.tar.gz
settings: Fix crash when terminating programs (Bug #15489)
Diffstat (limited to 'settings')
-rw-r--r--settings/session-editor.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/settings/session-editor.c b/settings/session-editor.c
index a3bea1a2..d8e412e0 100644
--- a/settings/session-editor.c
+++ b/settings/session-editor.c
@@ -292,24 +292,17 @@ session_editor_quit_client(GtkWidget *btn,
GError *error = NULL;
if(hint != SmRestartIfRunning) {
- GHashTable *properties = g_hash_table_new(g_str_hash, g_str_equal);
- GValue val = { 0, };
+ GVariantBuilder properties;
GVariant *variant;
- g_value_init(&val, G_TYPE_UCHAR);
- g_value_set_uchar(&val, SmRestartIfRunning);
- g_hash_table_insert(properties, SmRestartStyleHint, &val);
-
- variant = g_variant_new ("a{sv}", properties);
+ g_variant_builder_init (&properties, G_VARIANT_TYPE ("a{sv}"));
+ variant = g_variant_new_byte(SmRestartIfRunning);
+ g_variant_builder_add (&properties, "{sv}", SmRestartStyleHint, variant);
- if(!xfsm_client_call_set_sm_properties_sync(proxy, variant, NULL, &error)) {
- /* FIXME: show error */
- g_error_free(error);
+ if(!xfsm_client_call_set_sm_properties_sync(proxy, g_variant_builder_end (&properties), NULL, &error)) {
+ g_error("error setting 'SmRestartStyleHint', error: %s", error->message);
+ g_clear_error(&error);
}
-
- g_value_unset(&val);
- g_hash_table_destroy(properties);
- g_variant_unref(variant);
}
if(!xfsm_client_call_terminate_sync(proxy, NULL, &error)) {
@@ -640,7 +633,7 @@ priority_changed(GtkCellRenderer *render,
if(!xfsm_client_call_set_sm_properties_sync(proxy, g_variant_builder_end (&properties), NULL, &error)) {
g_error("error setting 'GsmPriority', error: %s", error->message);
- g_error_free(error);
+ g_clear_error(&error);
}
gtk_list_store_set (GTK_LIST_STORE (model), &iter,