Hi,
I am developing a package that, among other things, runs user-defined functions that may allocate data, open an write to files and run external programs. Is there a function similar to workspace()
that I can call inside a script to make sure all resources allocated by a function are freed?
In more detail, I need to cleanly rerun user-defined functions multiple times and I would like to know if there is a way to force or make sure that, regarding those function calls, I/O is done, opened files are closed, allocated variables are freed and external programs finished.
Thank you!