From fa485bda233dbf3fc885816b6b0f4e95fe034ab7 Mon Sep 17 00:00:00 2001 From: stippi Date: Thu, 22 Apr 2010 21:01:42 +0000 Subject: [PATCH] When removing the currently selected tab, temporarily unset the current BWebView, since we did not delete the BWebView directly, but in the application thread, this was a race condition that would only crash sometimes (in _TabChanged(), when we tried to attach user data to the current tab before switching it). This should fix the last known (to me) crash. git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@452 94f232f2-1747-11df-bad5-a5bfde151594 --- src/apps/webpositive/BrowserWindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/apps/webpositive/BrowserWindow.cpp b/src/apps/webpositive/BrowserWindow.cpp index 784d4a2f6a..cd13d89309 100644 --- a/src/apps/webpositive/BrowserWindow.cpp +++ b/src/apps/webpositive/BrowserWindow.cpp @@ -694,7 +694,7 @@ BrowserWindow::QuitRequested() // Do this here, so WebKit tear down happens earlier. while (fTabManager->CountTabs() > 0) _ShutdownTab(0); - SetCurrentWebView(0); + SetCurrentWebView(NULL); BMessage message(WINDOW_CLOSED); message.AddRect("window frame", Frame()); @@ -1056,6 +1056,8 @@ BrowserWindow::_ShutdownTab(int32 index) { BView* view = fTabManager->RemoveTab(index); BWebView* webView = dynamic_cast(view); + if (webView == CurrentWebView()) + SetCurrentWebView(NULL); if (webView != NULL) webView->Shutdown(); else