Hello,
I've discovered that when DynamicForm (any DataBoundComponent) actually is drawn as part of Window, memory leak happens. Code to demonstrate this is below. After you run the code, please see how many live instances of RulesEngine class you have (isc_RulesEngine_0 etc objects in DevConsole). Those objects are not destroyed and (which is where I discovered the problem) hold reference to already destroyed "Window" objects. This did not happen in v11 where RulesEngine was not even created when DynamicForm is drawn. The problem most probably existed there though because if you call dynamicForm.getRulesEngine() explicitly (which is internal method I know), that instance of RulesEngine is never destroyed.
The code to demonstrate the problem:
var windows = []
for (var i = 0; i < 10; i++) {
var w = isc.Window.create({
items: [
isc.DynamicForm.create({fields: [{ name: "SomeField", editorType: "TextItem"}]})
]
});
w.show();
windows.push(w);
}
setTimeout ( function() {
for (var i =0; i < windows.length;i++) windows[i].destroy()
}, 1000);
I've discovered that when DynamicForm (any DataBoundComponent) actually is drawn as part of Window, memory leak happens. Code to demonstrate this is below. After you run the code, please see how many live instances of RulesEngine class you have (isc_RulesEngine_0 etc objects in DevConsole). Those objects are not destroyed and (which is where I discovered the problem) hold reference to already destroyed "Window" objects. This did not happen in v11 where RulesEngine was not even created when DynamicForm is drawn. The problem most probably existed there though because if you call dynamicForm.getRulesEngine() explicitly (which is internal method I know), that instance of RulesEngine is never destroyed.
The code to demonstrate the problem:
var windows = []
for (var i = 0; i < 10; i++) {
var w = isc.Window.create({
items: [
isc.DynamicForm.create({fields: [{ name: "SomeField", editorType: "TextItem"}]})
]
});
w.show();
windows.push(w);
}
setTimeout ( function() {
for (var i =0; i < windows.length;i++) windows[i].destroy()
}, 1000);
Comment