I am new to webix, but have almost 15 years of experience in ExtJS.
Currently I’m testing webix, looking for selected solutions and trying to understand how it works.
Problem:
Closing a window (by close method) with a previously connected internal event does not detach this event and leaves the window class instance in memory.
Scenario:
- I open the window
- attach an app event in the window:
this.on(this.app, ...)
- I close the window
- the event is still running and there is still an instance of the window class
Questions/Expectations:
When closing (via the close method) a window/popup, shouldn’t the instance of the window class be closed? - this will cause automatically detach events via _detachEvents
Close window only destroy root (view:“window”)
No one needs ghost-active instance of the class
Temporary solutions:
- instead of
close()
, dothis.destructor()
- after
close()
callthis._detachEvents()
It would be nice to attach events (app,webix) in properties “on”, something like:
return {
view:"window",
...
on: {
// phantom code ... Maybe it's good idea ?
// like: https://docs.sencha.com/extjs/7.6.0/classic/Ext.Component.html#method-on
"app:timer": {
scope: this.app,
fn: this.winTimer,
},
...
},
...
}
… maybe in this situation, destroy view window will cause detach all event from “on” props ?!
All problems are in example:
https://snippet.webix.com/jqmu20q9
I’m not saying that the situation described above is a mistake, but I have doubts about the validity of leaving instances in memory that will no longer be used for anything.
A special case are windows/popups, which (when closed, not hide) should sweep away unnecessary things and clear memory