cb->conn_func(connection, cb->user_data);
}
+ /* Check if the watch was removed/freed by the callback
+ * function */
+ if (!g_slist_find(data->callbacks, cb))
+ continue;
+
/* Only auto remove if it is a bus name watch */
if (data->argument[0] == ':' &&
(cb->conn_func == NULL || cb->disc_func == NULL)) {
continue;
}
- /* Check if the watch was removed/freed by the callback
- * function */
- if (!g_slist_find(data->callbacks, cb))
- continue;
-
data->callbacks = g_slist_remove(data->callbacks, cb);
data->processed = g_slist_append(data->processed, cb);
}