To properly close the library you must use the function:
void SCDeinit();
Beware: there must not be data variables, managed pointers used (also destructed) after.