+wxDLImports* wxPluginLibrary::ms_classes = NULL;
+
+class wxPluginLibraryModule : public wxModule
+{
+public:
+ wxPluginLibraryModule() { }
+
+ // TODO: create ms_classes on demand, why always preallocate it?
+ virtual bool OnInit()
+ {
+ wxPluginLibrary::ms_classes = new wxDLImports(wxKEY_STRING);
+ wxPluginManager::CreateManifest();
+ return TRUE;
+ }
+
+ virtual void OnExit()
+ {
+ delete wxPluginLibrary::ms_classes;
+ wxPluginLibrary::ms_classes = NULL;
+ wxPluginManager::ClearManifest();
+ }
+
+private:
+ DECLARE_DYNAMIC_CLASS(wxPluginLibraryModule )
+};
+
+IMPLEMENT_DYNAMIC_CLASS(wxPluginLibraryModule, wxModule)
+