]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/BASE/AliHLT_C_Component_WrapperInterface.cxx
Minor cleanup of code.
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLT_C_Component_WrapperInterface.cxx
index 8e096074528e322e6d3c14a27b1c079deb62f4ff..1027f02896136303d9f1302ff54de1d38457fbee 100644 (file)
@@ -66,20 +66,34 @@ int AliHLT_C_Component_LoadLibrary( const char* libraryPath )
   return gComponentHandler_C->LoadLibrary( libraryPath );
 }
 
-int AliHLT_C_Component_UnloadLibrary( const char* libraryPath )
+int AliHLT_C_Component_UnloadLibrary( const char* /*libraryPath*/ )
 {
   if ( !gComponentHandler_C )
     return ENXIO;
-  return gComponentHandler_C->UnloadLibrary( libraryPath );
+  // Matthias 26.10.2007
+  // Unloading of libraries has to be re-worked. It has been commented out here
+  // since the libraries will be unloaded at the destruction of the component
+  // handler instance anyway. So it has no effect to the operation in PubSub.
+  // With the introduction of the dynamic component registration via module
+  // agents we run into trouble when cleaning up the samples managed by the
+  // component handler. Destruction of the sample objects is done AFTER
+  // unloading of the library and thus the destructor is not present any 
+  // more.
+  //return gComponentHandler_C->UnloadLibrary( libraryPath );
+  return 0;
 }
 
 int AliHLT_C_CreateComponent( const char* componentType, void* environ_param, int argc, const char** argv, AliHLTComponentHandle* handle )
 {
   if ( !gComponentHandler_C )
     return ENXIO;
-  AliHLTComponent* comp;
-  int ret = gComponentHandler_C->CreateComponent( componentType, environ_param, argc, argv, comp );
+  if ( !handle ) return EINVAL;
+  AliHLTComponent* comp=NULL;
+  const char* cdbPath = getenv("ALIHLT_HCDBDIR");
+  if (!cdbPath) cdbPath = getenv("ALICE_ROOT");
+  int ret = gComponentHandler_C->CreateComponent( componentType, environ_param, argc, argv, comp, cdbPath);
   *handle = reinterpret_cast<AliHLTComponentHandle>( comp );
+
   return ret;
 }