[anjuta] build-basic-autotools: Remove idle for updating indicators when plugin is deactivated.
- From: Sebastien Granjoux <sgranjoux src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] build-basic-autotools: Remove idle for updating indicators when plugin is deactivated.
- Date: Sat, 1 Dec 2012 21:23:29 +0000 (UTC)
commit 7c9c6c2b476dcac63bffe0529ab31ffe072529c7
Author: Carl-Anton Ingmarsson <ca ingmarsson gmail com>
Date: Tue Nov 27 22:18:28 2012 +0100
build-basic-autotools: Remove idle for updating indicators when plugin is deactivated.
Also fix compile warning regarding zero parameter functions.
https://bugzilla.gnome.org/show_bug.cgi?id=689054
plugins/build-basic-autotools/plugin.c | 12 +++++++++---
plugins/build-basic-autotools/plugin.h | 3 +++
2 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/plugins/build-basic-autotools/plugin.c b/plugins/build-basic-autotools/plugin.c
index a3d0813..96bac38 100644
--- a/plugins/build-basic-autotools/plugin.c
+++ b/plugins/build-basic-autotools/plugin.c
@@ -450,7 +450,7 @@ build_context_reset (BuildContext *context)
}
static void
-build_regex_load ()
+build_regex_load (void)
{
FILE *fp;
@@ -520,7 +520,7 @@ build_regex_init_message (MessagePattern *patterns)
}
static void
-build_regex_init ()
+build_regex_init (void)
{
GList *node;
GError *error = NULL;
@@ -2378,6 +2378,8 @@ on_update_indicators_idle (gpointer data)
node = g_list_next (node);
}
}
+
+ ba_plugin->update_indicators_idle = 0;
return FALSE;
}
@@ -2444,7 +2446,7 @@ value_added_current_editor (AnjutaPlugin *plugin, const char *name,
ba_plugin->current_editor_file = ianjuta_file_get_file (IANJUTA_FILE (editor), NULL);
update_module_ui (ba_plugin);
- g_idle_add (on_update_indicators_idle, plugin);
+ ba_plugin->update_indicators_idle = g_idle_add (on_update_indicators_idle, plugin);
}
static void
@@ -2578,6 +2580,10 @@ deactivate_plugin (AnjutaPlugin *plugin)
anjuta_plugin_remove_watch (plugin, ba_plugin->project_build_watch_id, TRUE);
anjuta_plugin_remove_watch (plugin, ba_plugin->editor_watch_id, TRUE);
+ /* Remove scheduled idle handler. */
+ if (ba_plugin->update_indicators_idle)
+ g_source_remove (ba_plugin->update_indicators_idle);
+
/* Remove UI */
anjuta_ui_unmerge (ui, ba_plugin->build_merge_id);
diff --git a/plugins/build-basic-autotools/plugin.h b/plugins/build-basic-autotools/plugin.h
index 6dbf8f5..2835cfe 100644
--- a/plugins/build-basic-autotools/plugin.h
+++ b/plugins/build-basic-autotools/plugin.h
@@ -54,6 +54,9 @@ struct _BasicAutotoolsPlugin{
gint project_build_watch_id;
gint editor_watch_id;
+ /* GSource ids */
+ guint update_indicators_idle;
+
/* Watched values */
GFile *fm_current_file;
GFile *pm_current_file;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]