Browse Source

Remove callbackId when callback is removed from registry

Cheng Zhao 8 years ago
parent
commit
f792b6c752
1 changed files with 5 additions and 1 deletions
  1. 5 1
      lib/common/api/callbacks-registry.js

+ 5 - 1
lib/common/api/callbacks-registry.js

@@ -55,7 +55,11 @@ class CallbacksRegistry {
   }
 
   remove (id) {
-    return delete this.callbacks[id]
+    const callback = this.callbacks[id]
+    if (callback) {
+      v8Util.deleteHiddenValue(callback, 'callbackId')
+      delete this.callbacks[id]
+    }
   }
 }