Change -[WebHistoryItem copyWithZone:] to not use NSCopyObject()
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Jan 2012 20:01:04 +0000 (20:01 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Jan 2012 20:01:04 +0000 (20:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=75980

Reviewed by Mark Rowe.

* History/WebHistoryItem.mm:
(-[WebHistoryItem copyWithZone:]): Replaced NSCopyObject() with
-alloc, -initWithWebCoreHistoryItem:.

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

Source/WebKit/mac/ChangeLog
Source/WebKit/mac/History/WebHistoryItem.mm

index 7e58a39f848f215dd434b1500c03d20293a0d792..59c97c69576363ed5638588035ccdc45e66edd7c 100644 (file)
@@ -1,3 +1,14 @@
+2012-01-10  Dan Bernstein  <mitz@apple.com>
+
+        Change -[WebHistoryItem copyWithZone:] to not use NSCopyObject()
+        https://bugs.webkit.org/show_bug.cgi?id=75980
+
+        Reviewed by Mark Rowe.
+
+        * History/WebHistoryItem.mm:
+        (-[WebHistoryItem copyWithZone:]): Replaced NSCopyObject() with
+        -alloc, -initWithWebCoreHistoryItem:.
+
 2012-01-06  Simon Fraser  <simon.fraser@apple.com>
 
         Mitigate scrollbar differences when running pixel tests
index eef4346cd0fb694965e69938a000826c9d69ed9d..646d8bebb1fbc02832d3b2d1a268be845a2498b2 100644 (file)
@@ -141,11 +141,9 @@ void WKNotifyHistoryItemChanged(HistoryItem*)
 - (id)copyWithZone:(NSZone *)zone
 {
     WebCoreThreadViolationCheckRoundOne();
-    WebHistoryItem *copy = (WebHistoryItem *)NSCopyObject(self, 0, zone);
-    RefPtr<HistoryItem> item = core(_private)->copy();
-    copy->_private = kitPrivate(item.get());
-    historyItemWrappers().set(item.release().leakRef(), copy);
-    
+    WebHistoryItem *copy = [[WebHistoryItem alloc] initWithWebCoreHistoryItem:core(_private)->copy()];
+    historyItemWrappers().set(core(copy->_private), copy);
+
     return copy;
 }