Cesium icon indicating copy to clipboard operation
Cesium copied to clipboard

Hygienic termination

Open ForNeVeR opened this issue 1 year ago • 1 comments

Since we are starting to allocate persistent data that may outlive the runtime (see #478), it's time to discuss our cleanup policy.

I propose that we should try to support the running of multiple Cesium programs in the same runtime process, at least one after another, and also we should not leave any unused buffers or leak anything after ourselves, at least in correct programs.

In particular, I propose us to have some kind of a cleanup procedure that we'll call at the end of main (and, for any advanced hosting scenarios, the user would call themselves e.g. when loading a Cesium library).

That cleanup function would drop caches of getenv() and such, so that the runtime is ready for the next program run.

ForNeVeR avatar Nov 16 '23 22:11 ForNeVeR

That cleanup procedure may also be a good place for various assertions, to track memory leaks and such, in case we want this kind of business.

ForNeVeR avatar Nov 16 '23 22:11 ForNeVeR