X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/12aae76fbeaa3dc91ab5ecad5531a2c1925340d2..519fd4f22bc83ba85a8377a7ada53fac4e2e2b39:/projects/stargazer/store_loader.cpp diff --git a/projects/stargazer/store_loader.cpp b/projects/stargazer/store_loader.cpp index dbb6d36e..1529a2cc 100644 --- a/projects/stargazer/store_loader.cpp +++ b/projects/stargazer/store_loader.cpp @@ -30,9 +30,9 @@ #include +#include "stg/common.h" +#include "stg/store.h" #include "store_loader.h" -#include "common.h" -#include "store.h" #include "settings_impl.h" STORE_LOADER::STORE_LOADER(const SETTINGS_IMPL & settings) @@ -54,7 +54,7 @@ bool STORE_LOADER::Load() { if (isLoaded) { - errorStr = "Store plugin '" + pluginFileName + "' was alredy loaded!"; + errorStr = "Store plugin '" + pluginFileName + "' was already loaded!"; printfd(__FILE__, "STORE_LOADER::Load() - %s\n", errorStr.c_str()); return false; } @@ -79,7 +79,7 @@ if (!handle) isLoaded = true; STORE * (*GetStore)(); -GetStore = (STORE * (*)())dlsym(handle, "GetStore"); +GetStore = reinterpret_cast(dlsym(handle, "GetStore")); if (!GetStore) { errorStr = std::string("GetStore() not found! ") + dlerror(); @@ -115,6 +115,8 @@ if (!isLoaded) return true; } +delete plugin; + if (dlclose(handle)) { errorStr = "Failed to unload plugin '";