}
}
+AliHLTComponentHandler::TLibraryMode AliHLTComponentHandler::SetLibraryMode(TLibraryMode mode)
+{
+ // see header file for class documentation
+ TLibraryMode old=fLibraryMode;
+ fLibraryMode=mode;
+ return old;
+}
+
int AliHLTComponentHandler::LoadLibrary( const char* libraryPath, int bActivateAgents)
{
// see header file for class documentation
if (hLib.fHandle!=NULL) {
// create TString object to store library path and use pointer as handle
hLib.fName=new TString(libraryPath);
- HLTInfo("library %s loaded (%s)", libraryPath, loadtype);
+ hLib.fMode=fLibraryMode;
+ HLTInfo("library %s loaded (%s%s)", libraryPath, hLib.fMode==kStatic?"persistent, ":"", loadtype);
fLibraryList.insert(fLibraryList.begin(), hLib);
typedef void (*CompileInfo)( char*& date, char*& time);
CompileInfo fctInfo=(CompileInfo)FindSymbol(libraryPath, "CompileInfo");
int iResult=0;
fgAliLoggingFunc=NULL;
TString* pName=reinterpret_cast<TString*>(handle.fName);
+ if (handle.fMode!=kStatic) {
#ifdef HAVE_DLFCN_H
try {
dlclose(handle.fHandle);
delete pCount;
}
#endif //HAVE_DLFCN_H
- handle.fName=NULL;
- handle.fHandle=NULL;
if (pName) {
HLTDebug("unload library %s", pName->Data());
- delete pName;
} else {
HLTWarning("missing name for unloaded library");
}
+ }
+ handle.fName=NULL;
+ handle.fHandle=NULL;
+ if (pName) {
+ delete pName;
+ }
pName=NULL;
return iResult;
}