2011-05-29 Darin Adler <darin@apple.com>
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 May 2011 20:12:27 +0000 (20:12 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 May 2011 20:12:27 +0000 (20:12 +0000)
        Reviewed by Dan Bernstein.

        Race condition in full screen controller, which leads to problem when web process crashes
        https://bugs.webkit.org/show_bug.cgi?id=61707

        Saw this while debugging a crash. We don't have a way to make regression tests for this
        kind of issue at this time.

        * UIProcess/mac/WKFullScreenWindowController.mm:
        (-[WKFullScreenWindowController exitAcceleratedCompositingMode]): Retain the controller
        here since we are keeping a pointer to it.
        (exitCompositedModeRepaintCompleted): Release the controller here.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@87644 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm

index c637e67..c762b9b 100644 (file)
@@ -1,3 +1,18 @@
+2011-05-29  Darin Adler  <darin@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Race condition in full screen controller, which leads to problem when web process crashes
+        https://bugs.webkit.org/show_bug.cgi?id=61707
+
+        Saw this while debugging a crash. We don't have a way to make regression tests for this
+        kind of issue at this time.
+
+        * UIProcess/mac/WKFullScreenWindowController.mm:
+        (-[WKFullScreenWindowController exitAcceleratedCompositingMode]): Retain the controller
+        here since we are keeping a pointer to it.
+        (exitCompositedModeRepaintCompleted): Release the controller here.
+
 2011-05-29  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Darin Adler.
index 3acf7e6..dc5c7e2 100644 (file)
@@ -395,6 +395,7 @@ static void exitCompositedModeRepaintCompleted(WKErrorRef, void* context);
         return;
 
     NSDisableScreenUpdates();
+    [self retain]; // Balanced by release in exitCompositedModeRepaintCompleted below.
     [self _page]->forceRepaint(VoidCallback::create(self, exitCompositedModeRepaintCompleted));
 }
 
@@ -414,7 +415,9 @@ static void exitCompositedModeRepaintCompleted(WKErrorRef, void* context);
 
 static void exitCompositedModeRepaintCompleted(WKErrorRef, void* context)
 {
-    [(WKFullScreenWindowController*)context exitCompositedModeRepaintCompleted];
+    WKFullScreenWindowController *controller = static_cast<WKFullScreenWindowController *>(context);
+    [controller exitCompositedModeRepaintCompleted];
+    [controller release]; // Balanced by retain in exitAcceleratedCompositingMode above.
 }
 
 - (WebCore::IntRect)getFullScreenRect