From b937ed1d8d0ec0bf6448a840f4d658452d359db0 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Thu, 6 Feb 2014 19:35:52 +0000 Subject: Avoid a potential crash when two tabs are opened and one of them is closed. --- amiga/gui.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'amiga/gui.c') diff --git a/amiga/gui.c b/amiga/gui.c index e482f5242..ece34ea77 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -1823,6 +1823,7 @@ void ami_handle_msg(void) switch(result & WMHI_GADGETMASK) { case GID_TABS: + if(gwin->objects[GID_TABS] == NULL) break; GetAttrs(gwin->objects[GID_TABS], CLICKTAB_NodeClosed, &tabnode, TAG_DONE); if(tabnode) @@ -3151,6 +3152,11 @@ void ami_toggletabbar(struct gui_window_2 *gwin, bool show) IDoMethod(gwin->objects[GID_TABLAYOUT], LM_REMOVECHILD, gwin->win, gwin->objects[GID_ADDTAB]); + + /* NB: We are NULLing these, but not disposing them as + * that causes an Intuition deadlock (TODO) */ + gwin->objects[GID_TABS] = NULL; + gwin->objects[GID_ADDTAB] = NULL; } FlushLayoutDomainCache((struct Gadget *)gwin->objects[GID_MAIN]); -- cgit v1.2.3