If we inject an object into VueComponent as below:
var store = new _vuex2.default.Store({
actions: _extends({}, appActions),
modules: {
app: _app2.default
}
});
new Vue(Vue.util.extend({ el: '#root', store: store }, _Qiqu2.default));
the Vue framework would remain all the references of Store objects and cause memory leaks happen.
We can get a compelete example bundle for reproducing the issue here
Run this bundle on Weex platform and lets take heap snapshots and compare them as below:
From above we would found out:
not all dependencies's subscribers get teardown, we need to set Watcher.vm to nulls.
The VueComponent tree remains in memory, we need to set the reference of root VueComponent and destroy the document.
If we inject an object into VueComponent as below:
the Vue framework would remain all the references of Store objects and cause memory leaks happen.
We can get a compelete example bundle for reproducing the issue here
Run this bundle on Weex platform and lets take heap snapshots and compare them as below:
From above we would found out: