mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Fixed memory leak on game re-init.
This commit is contained in:
@@ -476,6 +476,12 @@ namespace loot {
|
||||
if (!localAppData.empty())
|
||||
gameLocalDataPath = localAppData.c_str();
|
||||
|
||||
// If the handle has already been initialised, close it and open another.
|
||||
if (gh != nullptr) {
|
||||
lo_destroy_handle(gh);
|
||||
gh = nullptr;
|
||||
}
|
||||
|
||||
int ret;
|
||||
if (Id() == Game::tes4)
|
||||
ret = lo_create_handle(&gh, LIBLO_GAME_TES4, gamePath.string().c_str(), gameLocalDataPath);
|
||||
|
||||
Reference in New Issue
Block a user