[haiku-webkit-commits] r452 - webkit/trunk/WebKit/haiku/WebPositive

  • From: webkit@xxxxxxxxxxxxxxx
  • To: haiku-webkit-commits@xxxxxxxxxxxxx
  • Date: Thu, 22 Apr 2010 21:01:42 +0000

Author: stippi
Date: Thu Apr 22 21:01:42 2010
New Revision: 452
URL: http://mmlr.dyndns.org/changeset/452

Log:
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.

Modified:
   webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.cpp

Modified: webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.cpp     Thu Apr 22 
14:51:39 2010        (r451)
+++ webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.cpp     Thu Apr 22 
21:01:42 2010        (r452)
@@ -694,7 +694,7 @@
        // 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 @@
 {
        BView* view = fTabManager->RemoveTab(index);
        BWebView* webView = dynamic_cast<BWebView*>(view);
+       if (webView == CurrentWebView())
+               SetCurrentWebView(NULL);
        if (webView != NULL)
                webView->Shutdown();
        else

Other related posts:

  • » [haiku-webkit-commits] r452 - webkit/trunk/WebKit/haiku/WebPositive - webkit