This repository was archived by the owner on Mar 18, 2026. It is now read-only.
Conversation
during page navigation, for some reason the page and component instance is not released re #2712
4 tasks
nishino-tsukasa
requested review from
nishino-tsukasa
and removed request for
nishino-tsukasa
May 23, 2022 05:44
nishino-tsukasa
suggested changes
May 23, 2022
| }); | ||
| this._watcher.cleanupDeps(); | ||
| this._watcher.teardown(); | ||
| this._watchers.forEach(item => { |
Collaborator
There was a problem hiding this comment.
this._watchers.slice().forEach,因为 teardown 会从 _watchers 里把自身删掉
| let lifecycle = getLifecycycle(WEAPP_COMPONENT_LIFECYCLE, rel, 'component'); | ||
| output.detached = function(...args) { | ||
| let vm = this.$wepy; | ||
| vm.$destroy(); |
Collaborator
There was a problem hiding this comment.
这个应该在 callUserMethod(vm, vm.$options, 'detached', args); 之后执行吧
Comment on lines
+65
to
+69
| this.$children.forEach(child => { | ||
| if (!child._detached) { | ||
| child.$destroy(); | ||
| } | ||
| }); |
Collaborator
There was a problem hiding this comment.
这个是不是没必要,组件自己也是会调用 detached 进行析构的
Comment on lines
+79
to
+81
| delete this._data.__ob__; | ||
| delete this._data; | ||
| delete this._watcher; |
Collaborator
There was a problem hiding this comment.
这几个应该都不用删。测了下,删这几个
delete this.$parent; delete this.$root; delete this.$wx.$wepy;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
npm run testpasses