Browse Source

only call cleanup when not deferring

Evan You 10 years ago
parent
commit
d2821b0cd1
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/instance/lifecycle.js

+ 3 - 1
src/instance/lifecycle.js

@@ -123,7 +123,9 @@ exports._bindDir = function (descriptor, node, host, scope, frag) {
 
 
 exports._destroy = function (remove, deferCleanup) {
 exports._destroy = function (remove, deferCleanup) {
   if (this._isBeingDestroyed) {
   if (this._isBeingDestroyed) {
-    this._cleanup()
+    if (!deferCleanup) {
+      this._cleanup()
+    }
     return
     return
   }
   }
   this._callHook('beforeDestroy')
   this._callHook('beforeDestroy')