Fix crash when switching to tabs that are still loading

svn path=/trunk/netsurf/; revision=9562
This commit is contained in:
Chris Young 2009-09-08 22:59:47 +00:00
parent 665b6ceb02
commit 7f369b829b

View File

@ -1481,6 +1481,7 @@ void gui_poll(bool active)
void ami_switch_tab(struct gui_window_2 *gwin,bool redraw)
{
struct Node *tabnode;
struct IBox *bbox;
if(gwin->tabs == 0) return;
@ -1491,13 +1492,19 @@ void ami_switch_tab(struct gui_window_2 *gwin,bool redraw)
TNA_UserData,&gwin->bw,
TAG_DONE);
curbw = gwin->bw;
GetAttr(SPACE_AreaBox,gwin->gadgets[GID_BROWSER],(ULONG *)&bbox);
if(!gwin->bw->current_content)
{
p96RectFill(gwin->win->RPort, bbox->Left, bbox->Top,
bbox->Width+bbox->Left, bbox->Height+bbox->Top, 0xffffffff);
return;
}
ami_update_buttons(gwin);
if(redraw)
{
struct IBox *bbox;
GetAttr(SPACE_AreaBox,gwin->gadgets[GID_BROWSER],(ULONG *)&bbox);
p96RectFill(gwin->win->RPort,bbox->Left,bbox->Top,bbox->Width+bbox->Left,bbox->Height+bbox->Top,0xffffffff);
browser_window_update(gwin->bw,false);