Changeset 4865 for branches/erijo-dev
- Timestamp:
- 03/13/07 06:30:22 (21 months ago)
- Location:
- branches/erijo-dev/licq/src/utils
- Files:
-
- 2 modified
-
dynamiclibrary.cpp (modified) (2 diffs)
-
dynamiclibrary.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/erijo-dev/licq/src/utils/dynamiclibrary.cpp
r4827 r4865 24 24 #include <dlfcn.h> 25 25 26 Licq::TDynamicLibrary::TDynamicLibrary(ILog* log, void* dlHandle, const std::string& filename) 26 Licq::TDynamicLibrary::TDynamicLibrary(ILog* log, void* dlHandle, 27 const std::string& filename) 27 28 : Log(log), DlHandle(dlHandle), Filename(filename) 28 29 { … … 33 34 { 34 35 if (::dlclose(DlHandle) != 0) 35 Log->error("Error when unloading library: %s", ::dlerror());36 Log->error("Error when unloading %s: %s", Filename.c_str(), ::dlerror()); 36 37 } 37 38 38 Licq::TDynamicLibrary* Licq::TDynamicLibrary::open(ILog* log, const std::string& filename) 39 Licq::TDynamicLibrary* Licq::TDynamicLibrary::open(ILog* log, 40 const std::string& filename) 39 41 { 40 42 assert(log != NULL); -
branches/erijo-dev/licq/src/utils/dynamiclibrary.h
r4839 r4865 46 46 47 47 Before calling the destructor, make absolutely sure that no symbols residing 48 in this library isstill in use. Otherwise prepare for a crash.48 in this library are still in use. Otherwise prepare for a crash. 49 49 */ 50 50 ~TDynamicLibrary(); … … 54 54 \param[in] log The log to log errors to. 55 55 \param[in] filename Library to open. See dlopen(3) on your system for how 56 this name is resolved.56 this name is resolved. 57 57 58 58 \return NULL on error; otherwise a new instance of TDynamicLibrary. 59 Caller is responsible for deleting returned object.59 Caller is responsible for deleting returned object. 60 60 */ 61 61 static TDynamicLibrary* open(ILog* log, const std::string& filename); … … 81 81 82 82 template<typename SymbolType> 83 inline bool Licq::TDynamicLibrary::loadSymbol(const std::string& name, SymbolType* symbol) 83 inline bool Licq::TDynamicLibrary::loadSymbol(const std::string& name, 84 SymbolType* symbol) 84 85 { 85 86 return loadSymbol(name, reinterpret_cast<void**>(symbol));
