summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonsta <[email protected]>2015-11-12 13:27:10 +0300
committermonsta <[email protected]>2015-11-30 10:45:25 +0300
commitb6c8f86bd32139b22513408bd402d1840ea13302 (patch)
tree069599bb3bcfe2ece59bb61578a05e271696eb4b
parentb1c76b5a6639ff268d557c3e4b7f03ea9d9db677 (diff)
downloadmate-power-manager-b6c8f86bd32139b22513408bd402d1840ea13302.tar.bz2
mate-power-manager-b6c8f86bd32139b22513408bd402d1840ea13302.tar.xz
fix warnings due to wrong id passed to g_source_remove
-rw-r--r--src/gpm-dpms.c4
-rw-r--r--src/gpm-idle.c9
-rw-r--r--src/gpm-manager.c5
3 files changed, 14 insertions, 4 deletions
diff --git a/src/gpm-dpms.c b/src/gpm-dpms.c
index 8eaf704..644ffe7 100644
--- a/src/gpm-dpms.c
+++ b/src/gpm-dpms.c
@@ -321,8 +321,10 @@ gpm_dpms_finalize (GObject *object)
g_return_if_fail (dpms->priv != NULL);
- if (dpms->priv->timer_id != 0)
+ if (dpms->priv->timer_id != 0) {
g_source_remove (dpms->priv->timer_id);
+ dpms->priv->timer_id = 0;
+ }
G_OBJECT_CLASS (gpm_dpms_parent_class)->finalize (object);
}
diff --git a/src/gpm-idle.c b/src/gpm-idle.c
index a7132fa..67dbeee 100644
--- a/src/gpm-idle.c
+++ b/src/gpm-idle.c
@@ -411,10 +411,15 @@ gpm_idle_finalize (GObject *object)
g_return_if_fail (idle->priv != NULL);
- if (idle->priv->timeout_blank_id != 0)
+ if (idle->priv->timeout_blank_id != 0) {
g_source_remove (idle->priv->timeout_blank_id);
- if (idle->priv->timeout_sleep_id != 0)
+ idle->priv->timeout_blank_id = 0;
+ }
+
+ if (idle->priv->timeout_sleep_id != 0) {
g_source_remove (idle->priv->timeout_sleep_id);
+ idle->priv->timeout_sleep_id = 0;
+ }
g_object_unref (idle->priv->load);
g_object_unref (idle->priv->session);
diff --git a/src/gpm-manager.c b/src/gpm-manager.c
index f6c498e..050d3ec 100644
--- a/src/gpm-manager.c
+++ b/src/gpm-manager.c
@@ -1945,8 +1945,11 @@ gpm_manager_finalize (GObject *object)
gpm_manager_notify_close (manager, manager->priv->notification_discharging);
if (manager->priv->notification_fully_charged != NULL)
gpm_manager_notify_close (manager, manager->priv->notification_fully_charged);
- if (manager->priv->critical_alert_timeout_id != 0)
+
+ if (manager->priv->critical_alert_timeout_id != 0) {
g_source_remove (manager->priv->critical_alert_timeout_id);
+ manager->priv->critical_alert_timeout_id = 0;
+ }
g_object_unref (manager->priv->settings);
g_object_unref (manager->priv->dpms);