Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rts/System/Platform/Win/win32.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#undef DeleteFile
#undef SendMessage
#undef GetCharWidth
#undef MemoryBarrier
#undef far
#undef near
#undef FAR
Expand Down
8 changes: 8 additions & 0 deletions test/unitsync/testUnitSync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,4 +350,12 @@ TEST_CASE("UnitSync")
if ((errmsg = us::GetNextError()) == nullptr) {
FAIL_CHECK("No error on GetWritableDataDirectory before init"); // there's an error cause we called GetWritableDataDirectory() after UnInit()!
}

// Exercise repeated initialization and shutdown.
for (int cycle = 0; cycle < 2; ++cycle) {
CHECK(us::Init(false, 0) != 0);
CHECK_ERROR_MESSAGE(errmsg);
us::UnInit();
CHECK_ERROR_MESSAGE(errmsg);
}
}
3 changes: 2 additions & 1 deletion tools/unitsync/unitsync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// shared with spring:
#include "lib/lua/include/LuaInclude.h"
#include "Game/GameVersion.h"
#include "Lua/LuaMemPool.h"
#include "Lua/LuaParser.h"
#include "Map/MapParser.h"
#include "Map/ReadMap.h"
Expand Down Expand Up @@ -421,6 +422,7 @@ EXPORT(void) UnInit()
try {
_Cleanup();
FileSystemInitializer::Cleanup();
LuaMemPool::KillStatic();
ConfigHandler::Deallocate();
DataDirLocater::FreeInstance();
}
Expand Down Expand Up @@ -2371,4 +2373,3 @@ EXPORT(const char*) GetMacAddrHash() {
memcpy(macAddrBuf.data(), macAddrHash.data(), std::min(macAddrHash.size(), macAddrBuf.size()));
return (macAddrBuf.data());
}