diff options
| author | KiritoDv <kiritodev01@gmail.com> | 2023-08-25 01:06:43 -0600 |
|---|---|---|
| committer | KiritoDv <kiritodev01@gmail.com> | 2023-08-25 01:06:43 -0600 |
| commit | f5cbd0056d601e4adaf5ed9006192dd510226ee3 (patch) | |
| tree | 6dde10bc24cec621c69376e0ec63e1f708d557ee /src/storm/SWrapper.cpp | |
| parent | def5b5e29b53ee876c55f9e37964a60ea472f3e8 (diff) | |
Fixed crash on linux
Diffstat (limited to 'src/storm/SWrapper.cpp')
| -rw-r--r-- | src/storm/SWrapper.cpp | 8 |
1 files changed, 4 insertions, 4 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 |
