summaryrefslogtreecommitdiff
path: root/gnome-settings-daemon
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2014-07-15 12:57:55 +0200
committerBastien Nocera <hadess@hadess.net>2014-07-15 12:57:55 +0200
commit84315ec620be6615cada80cb197c2891663068e0 (patch)
treef9c5c13f02e899ed6c0a485b0d851242593caff5 /gnome-settings-daemon
parenta540a05c48f290aee19cf61e0946002717a9ffb8 (diff)
downloadgnome-settings-daemon-84315ec620be6615cada80cb197c2891663068e0.tar.gz
daemon: Fix crash when a plugin failed to start
When a plugin failed to start, and wouldn't return an error, we'd crash trying to access the error. The error wasn't immediately visible as this part of the code is implemented as one large macro. This fixes a crash on startup when gnome-settings-daemon is compiled with systemd support but logind isn't available on the running system. https://bugzilla.gnome.org/show_bug.cgi?id=732836
Diffstat (limited to 'gnome-settings-daemon')
-rw-r--r--gnome-settings-daemon/gnome-settings-plugin.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/gnome-settings-daemon/gnome-settings-plugin.h b/gnome-settings-daemon/gnome-settings-plugin.h
index 5a167e85..1c505ce5 100644
--- a/gnome-settings-daemon/gnome-settings-plugin.h
+++ b/gnome-settings-daemon/gnome-settings-plugin.h
@@ -121,8 +121,8 @@ impl_activate (GnomeSettingsPlugin *plugin) \
g_debug ("Activating %s plugin", G_STRINGIFY(plugin_name)); \
plugin_cast = G_TYPE_CHECK_INSTANCE_CAST ((plugin), plugin_name##_plugin_get_type(), PluginName##Plugin); \
if (!plugin_name##_manager_start (plugin_cast->priv->manager, &error)) { \
- g_warning ("Unable to start %s manager: %s", G_STRINGIFY(plugin_name), error->message); \
- g_error_free (error); \
+ g_warning ("Unable to start %s manager: %s", G_STRINGIFY(plugin_name), error ? error->message : "No reason"); \
+ g_clear_error (&error); \
} \
} \
\