瀏覽代碼

Release event listener after request is canceled

Ben Hsieh 8 年之前
父節點
當前提交
219216dad1
共有 1 個檔案被更改,包括 2 行新增0 行删除
  1. 2
    0
      src/index.js

+ 2
- 0
src/index.js 查看文件

@@ -161,6 +161,8 @@ function fetch(...args:any):Promise {
161 161
   }
162 162
   promise.cancel = (fn) => {
163 163
     fn = fn || function(){}
164
+    subscription.remove()
165
+    subscriptionUpload.remove()
164 166
     RNFetchBlob.cancelRequest(taskId, fn)
165 167
   }
166 168