diff options
author | droger <droger@chromium.org> | 2015-11-12 04:47:31 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-12 12:48:31 +0000 |
commit | 222e9bc5aecf5436ae58dd171a01d6f548e97a28 (patch) | |
tree | b4b88a06ce0b61b579909657b9ade403a4774ad7 /ios/web | |
parent | e48ba349d22dfa01b379b3ef55869070bce25083 (diff) | |
download | chromium_src-222e9bc5aecf5436ae58dd171a01d6f548e97a28.zip chromium_src-222e9bc5aecf5436ae58dd171a01d6f548e97a28.tar.gz chromium_src-222e9bc5aecf5436ae58dd171a01d6f548e97a28.tar.bz2 |
[iOS] Fix double free in CookieNotificationBridge
Review URL: https://codereview.chromium.org/1405243008
Cr-Commit-Position: refs/heads/master@{#359308}
Diffstat (limited to 'ios/web')
-rw-r--r-- | ios/web/net/cookie_notification_bridge.mm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ios/web/net/cookie_notification_bridge.mm b/ios/web/net/cookie_notification_bridge.mm index 8ebb9a7..a610f00 100644 --- a/ios/web/net/cookie_notification_bridge.mm +++ b/ios/web/net/cookie_notification_bridge.mm @@ -14,13 +14,14 @@ namespace web { CookieNotificationBridge::CookieNotificationBridge() { - observer_.reset([[NSNotificationCenter defaultCenter] + id<NSObject> observer = [[NSNotificationCenter defaultCenter] addObserverForName:NSHTTPCookieManagerCookiesChangedNotification object:[NSHTTPCookieStorage sharedHTTPCookieStorage] queue:nil usingBlock:^(NSNotification* notification) { - OnNotificationReceived(notification); - }]); + OnNotificationReceived(notification); + }]; + observer_.reset([observer retain]); } CookieNotificationBridge::~CookieNotificationBridge() { |