diff options
Diffstat (limited to 'project2/common/library.cpp')
-rw-r--r-- | project2/common/library.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/project2/common/library.cpp b/project2/common/library.cpp index 738803f..0c4a83b 100644 --- a/project2/common/library.cpp +++ b/project2/common/library.cpp @@ -1,27 +1,24 @@ #include <pch.hpp> #include <dlfcn.h> #include "scriptStorage.h" -#include "exceptions.h" #include "scripts.h" #include "library.h" #include "variables.h" -SimpleMessageException(LoadLibraryFailed); -SimpleMessageException(UnloadLibraryFailed); - Library::Library(ScriptNodePtr p) : SourceObject(p), - handle(dlopen(Variable(p, "path")(NULL), RTLD_NOW)) + path(p, "path"), + handle(dlopen(path(NULL), RTLD_NOW)) { if (!handle) { - throw LoadLibraryFailed(dlerror()); + throw LoadLibraryFailed(path(NULL), dlerror()); } } Library::~Library() { if (dlclose(handle)) { - throw UnloadLibraryFailed(dlerror()); + throw UnloadLibraryFailed(path(NULL), dlerror()); } } |