summaryrefslogtreecommitdiff
path: root/include/module/ModuleLoader.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/module/ModuleLoader.hpp')
-rwxr-xr-xinclude/module/ModuleLoader.hpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/module/ModuleLoader.hpp b/include/module/ModuleLoader.hpp
index 21905ec..045383f 100755
--- a/include/module/ModuleLoader.hpp
+++ b/include/module/ModuleLoader.hpp
@@ -28,6 +28,7 @@ struct Module {
#else
HMODULE handle;
#endif
+ void *user_data;
ModuleRegistry< Interface, CtorParams > *registry;
};
@@ -81,9 +82,11 @@ class BaseModuleLoader {
}
if( m.registry->initModule != 0 ) {
- m.registry->initModule( user_data );
+ m.registry->initModule( user_data );
}
+ m.user_data = user_data;
+
m_modules.insert( std::make_pair( m.registry->name, m ) );
}
}
@@ -96,7 +99,7 @@ class BaseModuleLoader {
typename mapType::iterator it = m_modules.begin( );
if( (*it).second.registry ) {
if( (*it).second.registry->destroyModule != 0 ) {
- (*it).second.registry->destroyModule( );
+ (*it).second.registry->destroyModule( (*it).second.user_data );
}
}
if( (*it).second.handle ) {