Fix crash on program exit. Always good to use defensive programming techniques...
git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@225 94f232f2-1747-11df-bad5-a5bfde151594
This commit is contained in:
@@ -353,13 +353,22 @@ void LauncherWindow::MessageReceived(BMessage* message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case TAB_CHANGED: {
|
case TAB_CHANGED: {
|
||||||
int32 index = message->FindInt32("index");
|
// This message may be received also when the last tab closed, i.e. with index == -1.
|
||||||
SetCurrentWebView(dynamic_cast<BWebView*>(m_tabView->ViewForTab(index)));
|
int32 index = -1;
|
||||||
updateTitle(m_tabView->TabAt(index)->Label());
|
message->FindInt32("index", &index);
|
||||||
m_url->SetText(CurrentWebView()->MainFrameURL());
|
BWebView* webView = dynamic_cast<BWebView*>(m_tabView->ViewForTab(index));
|
||||||
// Trigger update of the interface to the new page, by requesting
|
SetCurrentWebView(webView);
|
||||||
// to resend all notifications.
|
BTab* tab = m_tabView->TabAt(index);
|
||||||
CurrentWebView()->WebPage()->ResendNotifications();
|
if (tab)
|
||||||
|
updateTitle(tab->Label());
|
||||||
|
else
|
||||||
|
updateTitle("");
|
||||||
|
if (webView) {
|
||||||
|
m_url->SetText(webView->MainFrameURL());
|
||||||
|
// Trigger update of the interface to the new page, by requesting
|
||||||
|
// to resend all notifications.
|
||||||
|
webView->WebPage()->ResendNotifications();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user