diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/storm/SWrapper.cpp | 8 | ||||
| -rw-r--r-- | src/storm/SWrapper.h | 1 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/storm/SWrapper.cpp b/src/storm/SWrapper.cpp index e841f4a..2e3b109 100644 --- a/src/storm/SWrapper.cpp +++ b/src/storm/SWrapper.cpp @@ -16,10 +16,6 @@ SWrapper::SWrapper(const std::string& path) { } } -SWrapper::~SWrapper() { - SFileCloseArchive(this->hMpq); -} - bool SWrapper::CreateFile(std::string path, std::vector<char> data) { HANDLE hFile; #ifdef _WIN32 @@ -63,5 +59,9 @@ bool SWrapper::CreateFile(std::string path, std::vector<char> data) { } void SWrapper::Close() { + if(this->hMpq == nullptr) { + std::cout << "Archive already closed" << std::endl; + return; + } SFileCloseArchive(this->hMpq); }
\ No newline at end of file diff --git a/src/storm/SWrapper.h b/src/storm/SWrapper.h index 4801566..b7e50ec 100644 --- a/src/storm/SWrapper.h +++ b/src/storm/SWrapper.h @@ -7,7 +7,6 @@ class SWrapper { public: SWrapper(const std::string& path); - ~SWrapper(); std::vector<char> ReadFile(std::string path); bool CreateFile(std::string path, std::vector<char> data); |
