Debug Assertion during shutdown

This article is relevant for all .Net products

Debug assertions during shutdown indicate that a toolkit class instance is still alive during unloadToolbox(). In general when toolkit class instances are destroyed after unloadToolbox(), this might cause memory leaks or crashes (accessing freed resources).

Make sure that all toolkit instances are destroyed before unloadToolbox().

If you use toolkit classes as global variables, you should better replace them with pointers, which can be assigned and released after loadToolbox() and before unloadToolbox().

Application::stop() and Application::uninitialize() should also be called before calling unloadToolbox().
Application::stop() will close the endpoints and this way the client connections will be closed as well.