Changeset 6073 for code/trunk/src/libraries/core
- Timestamp:
- Nov 15, 2009, 11:44:58 PM (15 years ago)
- Location:
- code/trunk/src/libraries/core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/core/DynLib.cc
r5750 r6073 70 70 COUT(2) << "Loading module " << mName << std::endl; 71 71 72 72 std::string name = mName; 73 73 #ifdef ORXONOX_PLATFORM_LINUX 74 74 // dlopen() does not add .so to the filename, like windows does for .dll … … 93 93 94 94 if( DYNLIB_UNLOAD( m_hInst ) ) 95 95 { 96 96 ThrowException( 97 97 General, 98 98 "Could not unload dynamic library " + mName + 99 99 ". System Error: " + dynlibError()); 100 100 } 101 101 102 102 } -
code/trunk/src/libraries/core/DynLib.h
r5738 r6073 72 72 Resource 73 73 */ 74 74 class _CoreExport DynLib 75 75 { 76 77 76 protected: 77 std::string mName; 78 78 /// Gets the last loading error 79 79 std::string dynlibError(void); … … 95 95 */ 96 96 void unload(); 97 98 97 /// Get the name of the library 98 const std::string& getName(void) const { return mName; } 99 99 100 100 /** -
code/trunk/src/libraries/core/DynLibManager.cc
r5738 r6073 41 41 42 42 //----------------------------------------------------------------------- 43 44 45 46 43 DynLibManager::DynLibManager() 44 { 45 } 46 //----------------------------------------------------------------------- 47 47 DynLib* DynLibManager::load( const std::string& filename) 48 48 { 49 50 51 52 53 54 55 56 57 58 59 60 49 DynLibList::iterator i = mLibList.find(filename); 50 if (i != mLibList.end()) 51 { 52 return i->second; 53 } 54 else 55 { 56 DynLib* pLib = new DynLib(filename); 57 pLib->load(); 58 mLibList[filename] = pLib; 59 return pLib; 60 } 61 61 } 62 63 64 65 66 67 68 69 70 71 72 73 62 //----------------------------------------------------------------------- 63 void DynLibManager::unload(DynLib* lib) 64 { 65 DynLibList::iterator i = mLibList.find(lib->getName()); 66 if (i != mLibList.end()) 67 { 68 mLibList.erase(i); 69 } 70 lib->unload(); 71 delete lib; 72 } 73 //----------------------------------------------------------------------- 74 74 DynLibManager::~DynLibManager() 75 75 {
Note: See TracChangeset
for help on using the changeset viewer.