summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiedrius Statkevičius <[email protected]>2015-06-27 15:52:41 +0300
committerinfirit <[email protected]>2015-07-09 12:26:56 +0200
commit95a7399a73782de48d4e821c84bd0fc59a590f10 (patch)
treec687ec8e031048af6085718fc2e0a81b21c1fef9
parent3c7199e2d287fec29373582ed8eb90035e852f82 (diff)
downloadmate-notification-daemon-95a7399a73782de48d4e821c84bd0fc59a590f10.tar.bz2
mate-notification-daemon-95a7399a73782de48d4e821c84bd0fc59a590f10.tar.xz
daemon: clean up {add,remove}_exit_timeout()
Add a nonnull assertion, remove unnecessary {} around one return statement
-rw-r--r--src/daemon/daemon.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c
index ada9a2d..821de3e 100644
--- a/src/daemon/daemon.c
+++ b/src/daemon/daemon.c
@@ -182,20 +182,20 @@ static gboolean do_exit(gpointer user_data)
static void add_exit_timeout(NotifyDaemon* daemon)
{
+ g_assert_nonnull(daemon);
+
if (daemon->priv->exit_timeout_source > 0)
- {
return;
- }
daemon->priv->exit_timeout_source = g_timeout_add_seconds(IDLE_SECONDS, do_exit, NULL);
}
static void remove_exit_timeout(NotifyDaemon* daemon)
{
+ g_assert_nonnull(daemon);
+
if (daemon->priv->exit_timeout_source == 0)
- {
return;
- }
g_source_remove(daemon->priv->exit_timeout_source);
daemon->priv->exit_timeout_source = 0;