Changeset 180982 in webkit
- Timestamp:
- Mar 3, 2015 6:51:16 PM (9 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r180967 r180982 1 2015-03-03 Chris Dumez <cdumez@apple.com> 2 3 [WK2] Fix memory leak in _getCookieHeadersForTask 4 https://bugs.webkit.org/show_bug.cgi?id=142245 5 6 Reviewed by Alexey Proskuryakov. 7 8 Fix memory leak in _getCookieHeadersForTask. We are leaking the CFDictionary 9 returned by webKitCookieStorageCopyRequestHeaderFieldsForURL(). 10 11 This patch addresses the issue by storing the return CFDictionary in a 12 RetainPtr<CFDictionaryRef>. 13 14 * Shared/mac/CookieStorageShim.mm: 15 (-[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:]): 16 1 17 2015-03-03 Enrica Casucci <enrica@apple.com> 2 18 -
trunk/Source/WebKit2/Shared/mac/CookieStorageShim.mm
r179409 r180982 120 120 RetainPtr<NSURLSessionTask> strongTask = task; 121 121 CompletionHandlerBlock completionHandlerCopy = [completionHandler copy]; 122 RunLoop::main().dispatch([strongTask, completionHandlerCopy]{ 123 completionHandlerCopy(WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL(nullptr, (CFURLRef)[[strongTask currentRequest] URL])); 122 RunLoop::main().dispatch([strongTask, completionHandlerCopy] { 123 RetainPtr<CFDictionaryRef> headers = adoptCF(WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL(nullptr, (CFURLRef)[[strongTask currentRequest] URL])); 124 completionHandlerCopy(headers.get()); 124 125 [completionHandlerCopy release]; 125 126 });
Note: See TracChangeset
for help on using the changeset viewer.