| 35 | } |
| 36 | |
| 37 | bool dynamicLinker::open() { |
| 38 | // C++14: |
| 39 | // lib = std::make_unique<_void>( dlopen( libPath.c_str(), RTLD_NOW | RTLD_LOCAL ) ); |
| 40 | auto v = new _void( openLib() ); |
| 41 | lib = std::unique_ptr<_void>( v ); |
| 42 | |
| 43 | if ( lib->ptr() == nullptr ) { |
| 44 | lib = nullptr; |
| 45 | char* err = nullptr; |
| 46 | std::string s = (err == nullptr) ? "FATAL ERROR: no error!" : std::string(err); |
| 47 | throw openException(s); |
| 48 | } |
| 49 | |
| 50 | return true; |
| 51 | } |
| 52 | |
| 53 | dynamicLinker::~dynamicLinker() { |
| 54 | if( lib != nullptr ) { |
nothing calls this directly
no test coverage detected