technology: remove the pending_timeout source with g_source_remove
authorAlok Barsode <alok.barsode@linux.intel.com>
Thu, 6 Oct 2011 11:00:39 +0000 (14:00 +0300)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 6 Oct 2011 11:24:24 +0000 (13:24 +0200)
src/technology.c

index 2b1763a..c6fd826 100644 (file)
@@ -818,6 +818,7 @@ int __connman_technology_enabled(enum connman_service_type type)
        if (technology->pending_reply != NULL) {
                g_dbus_send_reply(connection, technology->pending_reply, DBUS_TYPE_INVALID);
                dbus_message_unref(technology->pending_reply);
        if (technology->pending_reply != NULL) {
                g_dbus_send_reply(connection, technology->pending_reply, DBUS_TYPE_INVALID);
                dbus_message_unref(technology->pending_reply);
+               g_source_remove(technology->pending_timeout);
                technology->pending_reply = NULL;
                technology->pending_timeout = 0;
        }
                technology->pending_reply = NULL;
                technology->pending_timeout = 0;
        }
@@ -908,7 +909,9 @@ int __connman_technology_disabled(enum connman_service_type type)
        if (technology->pending_reply != NULL) {
                g_dbus_send_reply(connection, technology->pending_reply, DBUS_TYPE_INVALID);
                dbus_message_unref(technology->pending_reply);
        if (technology->pending_reply != NULL) {
                g_dbus_send_reply(connection, technology->pending_reply, DBUS_TYPE_INVALID);
                dbus_message_unref(technology->pending_reply);
+               g_source_remove(technology->pending_timeout);
                technology->pending_reply = NULL;
                technology->pending_reply = NULL;
+               technology->pending_timeout = 0;
        }
 
        if (g_atomic_int_dec_and_test(&technology->enabled) == TRUE) {
        }
 
        if (g_atomic_int_dec_and_test(&technology->enabled) == TRUE) {