From 58f4907575d298afdf7c3caefef2f29d5945b350 Mon Sep 17 00:00:00 2001 From: John Estropia Date: Tue, 6 Sep 2016 11:13:16 +0900 Subject: [PATCH] Prevent retain cycles in NSManagedObjectContext (fixes #87) --- Sources/Info.plist | 2 +- Sources/Internal/NotificationObserver.swift | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/Sources/Info.plist b/Sources/Info.plist index 0de69c1..241ef86 100644 --- a/Sources/Info.plist +++ b/Sources/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.0.3 + 2.0.4 CFBundleSignature ???? CFBundleVersion diff --git a/Sources/Internal/NotificationObserver.swift b/Sources/Internal/NotificationObserver.swift index b1ca9c1..460bc73 100644 --- a/Sources/Internal/NotificationObserver.swift +++ b/Sources/Internal/NotificationObserver.swift @@ -32,14 +32,10 @@ internal final class NotificationObserver { // MARK: Public - let notificationName: String - let object: AnyObject? let observer: NSObjectProtocol init(notificationName: String, object: AnyObject?, queue: NSOperationQueue? = nil, closure: (note: NSNotification) -> Void) { - self.notificationName = notificationName - self.object = object self.observer = NSNotificationCenter.defaultCenter().addObserverForName( notificationName, object: object, @@ -50,10 +46,6 @@ internal final class NotificationObserver { deinit { - NSNotificationCenter.defaultCenter().removeObserver( - self.observer, - name: self.notificationName, - object: self.object - ) + NSNotificationCenter.defaultCenter().removeObserver(self.observer) } }