From 13a099e1321144d5aa1c2b19ff904d83edd6e596 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Wed, 1 Jul 2015 22:10:43 +0100 Subject: [PATCH] Fixed a C string lifetime-related bug. --- src/backend/game/load_order_handler.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/backend/game/load_order_handler.cpp b/src/backend/game/load_order_handler.cpp index 1077ea4c..26950603 100644 --- a/src/backend/game/load_order_handler.cpp +++ b/src/backend/game/load_order_handler.cpp @@ -55,8 +55,9 @@ namespace loot { } const char * gameLocalDataPath = nullptr; - if (!gameLocalAppData.empty()) - gameLocalDataPath = gameLocalAppData.string().c_str(); + string tempPathString = gameLocalAppData.string(); + if (!tempPathString.empty()) + gameLocalDataPath = tempPathString.c_str(); // If the handle has already been initialised, close it and open another. if (_gh != nullptr) {