             return self == nil
         }
         
-        promise(weakifyFulfill(), weakifyReject(), isCancelled)
+        promise(weakify(Promise.fulfill), weakify(Promise.reject), isCancelled)
     }
-    
+
+    private func weakify<V>(_ method: @escaping (Promise<Value>) -> (V) -> Void) -> (V) -> Void {
+        return { [weak self] (value: V) in
+            guard let self = self else { return }
+            
+            method(self)(value)
+        }
+    }
+
     public func then<ResultingValue>(on dispatcher: Dispatcher, onFulfilled: @escaping (Value) throws -> Fulfilled<ResultingValue>, onRejected: @escaping (Error) throws -> Fulfilled<ResultingValue>) -> Promise<ResultingValue> {
         return Promise<ResultingValue>(pendingPromise: self) { (resolve, reject) in
             self.onResolve(

            
        default:
            fatalError("Duplicate attempt to resolve promise")
        }
    }
    
    private func weakifyReject() -> (Error) -> Void {
        return { [weak self] (reason) in
            guard let strongSelf = self else { return }
            
            strongSelf.reject(reason)
        }
    }
    

        self.lock = Lock()
        self.state = .pending(Deferred(pending: pending))
        
        resolver(weakify(Promise.fulfill), weakify(Promise.reject))
    }

    private init<PendingValue>(pendingPromise: Promise<PendingValue>, _ resolver: (_ resolve: @escaping (Fulfilled<Value>) -> Void, _ reject: @escaping (Error) -> Void) -> Void) {
        self.lock = Lock()
        self.state = .pending(Deferred(pendingPromise: pendingPromise))
        
        resolver(weakify(Promise.resolve), weakify(Promise.reject))
    }
    
    private func fulfill(_ value: Value) {
