Luna::close

void close()

Closes Luna SDK.

Call this function to close Luna SDK. Most features provided by Luna SDK are not available after Luna SDK is closed. Calling this function when Luna SDK is not initialized or already closed does nothing and returns directly.

Initialized modules will be closed by this function in the reverse order of their initialization order, so they don't need to be closed manually.

Remark

All dynamic memory allocated from memalloc, memrealloc and memnew must be freed before calling close, all boxed objects created from new_object and object_alloc must be released before calling close too. Calls to memfree, memdelete, object_release and other functions after close results in undefined behavior, and usually a program crash. This often happens when you declare global variables that hold dynamic allocated resources (such as Ref) and memory blocks (such as UniquePtr, and containers like Vector, HashMap, etc.). Remember to clear such resources before calling close. For some containers, you should call clear then shrink_to_fit to eventually frees the internal memory buffer used by containers.