Changeset 167202 in webkit
- Timestamp:
- Apr 13, 2014 1:02:13 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r167201 r167202 1 2014-04-13 Andy Estes <aestes@apple.com> 2 3 REGRESSION (r167164): -[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:] _block_invoke can access a deallocated completionHandler 4 https://bugs.webkit.org/show_bug.cgi?id=131595 5 6 Reviewed by Dan Bernstein. 7 8 Make a copy of completionHandler and release it after we're done with it. 9 10 * Shared/mac/CookieStorageShim.mm: 11 (-[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:]): 12 1 13 2014-04-13 Pratik Solanki <psolanki@apple.com> 2 14 -
trunk/Source/WebKit2/Shared/mac/CookieStorageShim.mm
r167164 r167202 117 117 118 118 #if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 119 - (void)_getCookieHeadersForTask:(NSURLSessionTask*)task completionHandler:(void (^)(CFDictionaryRef))completionHandler 119 using CompletionHandlerBlock = void(^)(CFDictionaryRef); 120 - (void)_getCookieHeadersForTask:(NSURLSessionTask*)task completionHandler:(CompletionHandlerBlock)completionHandler 120 121 { 121 122 if (!completionHandler) … … 123 124 124 125 RetainPtr<NSURLSessionTask> strongTask = task; 125 RunLoop::main().dispatch([strongTask, completionHandler]{ 126 completionHandler(WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL(nullptr, (CFURLRef)[[strongTask currentRequest] URL])); 126 CompletionHandlerBlock completionHandlerCopy = [completionHandler copy]; 127 RunLoop::main().dispatch([strongTask, completionHandlerCopy]{ 128 completionHandlerCopy(WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL(nullptr, (CFURLRef)[[strongTask currentRequest] URL])); 129 [completionHandlerCopy release]; 127 130 }); 128 131 }
Note: See TracChangeset
for help on using the changeset viewer.