Best practices for restarting Ejecta engine in runtime
I was wondering what would be the recommended way (memory leaks wise, etc.) to restart the entire Ejecta engine in runtime and getting a fresh JS runtime environment.
To clarify - I'm not interested in loading other scripts dynamically but simply restarting with the same index.js on a fresh runtime. This will allow me to not worry so much about Garbage Collection during development, yet avoid low memory issues on iOS.
Thanks, Amit
That's a good question. There's currently no built-in way to do this.
I believe this would have to be implemented in the EJAppViewController.m: release the current EJJavaScriptView and create a new one. The binding function for this could be placed in the EJBindingEjectaCore.m.
I'll look into it in the coming days.
You can now use ejecta.load(file); to restart the whole engine with the given JS file. E.g. to restart with the default index.js:
ejecta.load('index.js');