Protect against attempt to initialise twice.

This commit is contained in:
Michael Drake 2013-09-09 13:00:24 +01:00
parent 172551870b
commit b10252e325

View File

@ -33,6 +33,7 @@
#define REDRAW_MAX 8000
struct treeview_globals {
bool initialised;
int line_height;
int furniture_width;
int step_width;
@ -3564,6 +3565,9 @@ nserror treeview_init(void)
int font_px_size;
int font_pt_size = 11;
if (tree_g.initialised == true)
return NSERROR_OK;
treeview_init_plot_styles(font_pt_size);
treeview_init_resources();
treeview_init_furniture();
@ -3577,6 +3581,8 @@ nserror treeview_init(void)
tree_g.icon_step = 23;
tree_g.move_offset = 18;
tree_g.initialised = true;
return NSERROR_OK;
}
@ -3590,5 +3596,7 @@ nserror treeview_fini(void)
hlcache_handle_release(treeview_res[i].c);
}
tree_g.initialised = false;
return NSERROR_OK;
}