summaryrefslogtreecommitdiffstats
path: root/ios/web
diff options
context:
space:
mode:
Diffstat (limited to 'ios/web')
-rw-r--r--ios/web/net/cookie_notification_bridge.mm7
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() {