Skip to content

Commit

Permalink
multiterm: Fix building with recent Vala versions
Browse files Browse the repository at this point in the history
Vala doesn't allow dynamic code as global variable initializers
anymore, so move the dynamic initialization inside plugin_init().

Interestingly, if this actually used to work is only because the
initialization wasn't actually dynamic in C, as a NULL GList is a
valid one and that's what it was initialized to.
  • Loading branch information
b4n committed Oct 15, 2014
1 parent 08fd8de commit 953532b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion multiterm/src/plugin.vala
Expand Up @@ -28,7 +28,7 @@ public Data geany_data;
public Functions geany_functions;

/* Widgets to clean up when the plugin is unloaded */
private List<Widget> toplevel_widgets = new List<Widget>();
private List<Widget> toplevel_widgets = null;

/* Geany calls this to determine min. required API/ABI version */
public int plugin_version_check(int abi_version)
Expand Down Expand Up @@ -57,6 +57,8 @@ public void plugin_init(Geany.Data data)
* unregistering and re-registering new types */
geany_plugin.module_make_resident();

toplevel_widgets = new List<Widget>();

/* Initialize plugin's configuration directory/file */
config_dir = Path.build_filename(geany_data.app.config_dir, "plugins", "multiterm");
config_file = Path.build_filename(config_dir, "multiterm.conf");
Expand Down Expand Up @@ -107,4 +109,5 @@ public void plugin_cleanup ()
{
foreach (Widget wid in toplevel_widgets)
wid.destroy();
toplevel_widgets = null;
}

0 comments on commit 953532b

Please sign in to comment.