Hello,
I have a question regarding the class LayerRegistry resp. CreatorRegistry. I am using the macro
REGISTER_LAYER_CLASS for registering the layers. I have looked at the source code of layer_factory.hpp and I have noticed the static pointer g_registry_.
static CreatorRegistry* g_registry_ = new CreatorRegistry();
I understand why a static pointer is used here, yet the reserved memory is never freed! (Visual Studio also reports some memory leaks)
Of course I know that the OS will clean up the memory when the process terminates but I am writing a library. If the library is loaded and unloaded multiple times by a single process, the memory leak is noticeable.
How could I free the memory without modifying the caffe code?