diff options
author | Giedrius Statkevičius <[email protected]> | 2015-06-27 15:52:41 +0300 |
---|---|---|
committer | infirit <[email protected]> | 2015-07-09 12:26:56 +0200 |
commit | 95a7399a73782de48d4e821c84bd0fc59a590f10 (patch) | |
tree | c687ec8e031048af6085718fc2e0a81b21c1fef9 /src/daemon | |
parent | 3c7199e2d287fec29373582ed8eb90035e852f82 (diff) | |
download | mate-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
Diffstat (limited to 'src/daemon')
-rw-r--r-- | src/daemon/daemon.c | 8 |
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; |