diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2014-02-06 19:35:52 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2014-02-06 19:35:52 +0000 |
commit | b937ed1d8d0ec0bf6448a840f4d658452d359db0 (patch) | |
tree | 520a2e88a2e952d491f88fbf5c2b50a0666dd266 /amiga/gui.c | |
parent | 823aad5ddf3aaea53dda9eec8572b75d16c80a70 (diff) | |
download | netsurf-b937ed1d8d0ec0bf6448a840f4d658452d359db0.tar.gz netsurf-b937ed1d8d0ec0bf6448a840f4d658452d359db0.tar.bz2 |
Avoid a potential crash when two tabs are opened and one of them is closed.
Diffstat (limited to 'amiga/gui.c')
-rw-r--r-- | amiga/gui.c | 6 |
1 files changed, 6 insertions, 0 deletions
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]); |