#include "unicode/utypes.h"
Go to the source code of this file.
Functions | |
void | u_cleanup (void) |
Clean up the system resources, such as allocated memory or open files, used in all ICU libraries. More... |
|
Clean up the system resources, such as allocated memory or open files, used in all ICU libraries. This will free/delete all memory owned by the ICU libraries, and return them to their original load state. All open ICU items (collators, resource bundles, converters, etc.) must be closed before calling this function, otherwise ICU may not free its allocated memory (e.g. close your converters and resource bundles before calling this function). Generally, this function should be called once just before an application exits. For applications that dynamically load and unload the ICU libraries (relatively uncommon), u_cleanup() should be called just before the library unload. u_cleanup() is not thread safe. All other threads should stop using ICU before calling this function. Any open ICU items will be left in an undefined state by u_cleanup(), and any subsequent attempt to use such an item will give unpredictable results. After calling u_cleanup(), an application may continue to use ICU by creating an ICU C++ object or opening new items (converters, collators, etc.) and using them. An application must use ICU from one single thread before allowing other threads or processes from using ICU. This is so that the ICU libraries can reinitialize in a thread safe manner. The use of u_cleanup() just before an application terminates is optional, but it should be called only once for performance reasons. The primary benefit is to eliminate reports of memory or resource leaks originating in ICU code from the results generated by heap analysis tools. Use this function with great care!
|