[geany/geany-plugins] 8116d2: debugger: Fix internal EnvTree state after plugin reload

Colomban Wendling git-noreply at xxxxx
Sat Jul 4 22:01:13 UTC 2015


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Sun, 12 Oct 2014 14:18:47 UTC
Commit:      8116d2b23322c0994bb909cf54d5da9d8a561739
             https://github.com/geany/geany-plugins/commit/8116d2b23322c0994bb909cf54d5da9d8a561739

Log Message:
-----------
debugger: Fix internal EnvTree state after plugin reload

As the module is resident, the global variables won't get reinitialized
automatically when the plugin is reloaded, so reinitialize them
explicitly.

This is especially important for the `empty_row` variable as not
re-initializing it will lead to a double-free, and possibly a crash.


Modified Paths:
--------------
    debugger/src/envtree.c

Modified: debugger/src/envtree.c
6 lines changed, 6 insertions(+), 0 deletions(-)
===================================================================
@@ -399,6 +399,12 @@ GtkWidget* envtree_init(void)
 	GtkTreeViewColumn *column;
 	GtkTreeSelection *selection;
 
+	/* (re)initialize globals in case plugin was reloaded but those not cleared */
+	page_read_only = FALSE;
+	entering_new_var = FALSE;
+	empty_row = NULL;
+	being_edited_value = NULL;
+
 	store = gtk_list_store_new (
 		N_COLUMNS,
 		G_TYPE_STRING,



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Plugins-Commits mailing list