simple-policy: remove the idle callback when the object finalizes

Avoids crashing if a rescan is scheduled but the policy module is
destroyed in the meantime
This commit is contained in:
George Kiagiadakis 2019-07-12 19:43:07 +03:00
parent 1ed004c3c1
commit eaaa9f7f35

View file

@ -43,6 +43,9 @@ simple_policy_finalize (GObject *object)
g_free (self->default_capture);
g_clear_pointer (&self->role_priorities, g_variant_unref);
if (self->pending_rescan)
g_source_remove (self->pending_rescan);
G_OBJECT_CLASS (simple_policy_parent_class)->finalize (object);
}