On 23/01/2020 03:59, JM wrote:
I have a custom class that does async operations. I like to understand
when does GC fires and cleans up variables, how to prevent GC from
cleaning the variable which is doing async operation and then once again
enable GC after the async task is over.
Here is the complete script. I would like to GC to preserve the variable
'task' till the async task is executing. However, after onDone is
called, GC is free to take whatever action necessary.
var task = new AsyncTask;
task.data = "some data";
task.onDone = function(task) {
}
task.execute();
Please suggest.