Crash in [WebSharingServicePickerController clear]
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 May 2014 21:27:31 +0000 (21:27 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 May 2014 21:27:31 +0000 (21:27 +0000)
<rdar://problem/16879073> and https://bugs.webkit.org/show_bug.cgi?id=132968

Reviewed by Tim Horton.

* Misc/WebSharingServicePickerController.mm:
(-[WebSharingServicePickerController clear]): Add a RetainPtr protector so this object
  isn’t dealloc’ed partway through.

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

Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Misc/WebSharingServicePickerController.mm

index ad3be87..7cc9393 100644 (file)
@@ -1,3 +1,14 @@
+2014-05-15  Brady Eidson  <beidson@apple.com>
+
+        Crash in [WebSharingServicePickerController clear]
+        <rdar://problem/16879073> and https://bugs.webkit.org/show_bug.cgi?id=132968
+
+        Reviewed by Tim Horton.
+
+        * Misc/WebSharingServicePickerController.mm:
+        (-[WebSharingServicePickerController clear]): Add a RetainPtr protector so this object
+          isn’t dealloc’ed partway through.
+
 2014-05-15  Simon Fraser  <simon.fraser@apple.com>
 
         Initialize the WebKitRegionBasedColumnsEnabled pref on iOS WK1
index d21bc38..4733cef 100644 (file)
@@ -92,6 +92,9 @@ using namespace WebCore;
 
 - (void)clear
 {
+    // Protect self from being dealloc'ed partway through this method.
+    RetainPtr<WebSharingServicePickerController> protector(self);
+
     if (_menuClient)
         _menuClient->clearSharingServicePickerController();