https://bugs.webkit.org/show_bug.cgi?id=132472
Reviewed by Geoffrey Garen.
Fix memory leaks.
* TestWebKitAPI/Tests/mac/WillSendSubmitEvent.mm:
(TestWebKitAPI::TEST):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::willSendRequestForFrame):
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::changeWindowScaleIfNeeded):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168177
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-05-02 Simon Fraser <simon.fraser@apple.com>
+
+ Fix several memory leaks found by code inspection
+ https://bugs.webkit.org/show_bug.cgi?id=132472
+
+ Reviewed by Geoffrey Garen.
+
+ Fix memory leaks.
+
+ * TestWebKitAPI/Tests/mac/WillSendSubmitEvent.mm:
+ (TestWebKitAPI::TEST):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::willSendRequestForFrame):
+ * WebKitTestRunner/mac/PlatformWebViewMac.mm:
+ (WTR::PlatformWebView::changeWindowScaleIfNeeded):
+
2014-05-02 Filip Pizlo <fpizlo@apple.com>
DFGAbstractInterpreter should not claim Int52 arithmetic creates Int52s
@autoreleasepool {
RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
- RetainPtr<FormDelegate> formDelegate = [[FormDelegate alloc] init];
+ RetainPtr<FormDelegate> formDelegate = adoptNS([[FormDelegate alloc] init]);
[webView _setFormDelegate:formDelegate.get()];
[[webView.get() mainFrame] loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"auto-submitting-form" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]];
if (!mainFrameURL || WKStringIsEqualToUTF8CString(adoptWK(WKURLCopyString(mainFrameURL.get())).get(), "about:blank"))
mainFrameURL = adoptWK(WKBundleFrameCopyProvisionalURL(mainFrame));
- WKRetainPtr<WKStringRef> mainFrameHost = WKURLCopyHostName(mainFrameURL.get());
- WKRetainPtr<WKStringRef> mainFrameScheme = WKURLCopyScheme(mainFrameURL.get());
+ WKRetainPtr<WKStringRef> mainFrameHost = adoptWK(WKURLCopyHostName(mainFrameURL.get()));
+ WKRetainPtr<WKStringRef> mainFrameScheme = adoptWK(WKURLCopyScheme(mainFrameURL.get()));
mainFrameIsExternal = isHTTPOrHTTPSScheme(mainFrameScheme.get()) && !isLocalHost(mainFrameHost.get());
}
if (!mainFrameIsExternal) {
// Instead of re-constructing the current window, let's fake resize it to ensure that the scale change gets picked up.
forceWindowFramesChanged();
// Changing the scaling factor on the window does not trigger NSWindowDidChangeBackingPropertiesNotification. We need to send the notification manually.
- RetainPtr<NSMutableDictionary> notificationUserInfo = [[NSMutableDictionary alloc] initWithCapacity:1];
+ RetainPtr<NSMutableDictionary> notificationUserInfo = adoptNS([[NSMutableDictionary alloc] initWithCapacity:1]);
[notificationUserInfo setObject:[NSNumber numberWithDouble:currentScale] forKey:NSBackingPropertyOldScaleFactorKey];
[[NSNotificationCenter defaultCenter] postNotificationName:NSWindowDidChangeBackingPropertiesNotification object:m_window userInfo:notificationUserInfo.get()];
}