summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/gameinfo.cpp7
-rw-r--r--src/shared/gameinfo.h4
-rw-r--r--src/shared/leaktrace.cpp1
-rw-r--r--src/shared/shared.pro10
4 files changed, 20 insertions, 2 deletions
diff --git a/src/shared/gameinfo.cpp b/src/shared/gameinfo.cpp
index 6b53450d..f74e52b4 100644
--- a/src/shared/gameinfo.cpp
+++ b/src/shared/gameinfo.cpp
@@ -40,6 +40,13 @@ GameInfo* GameInfo::s_Instance = NULL;
GameInfo::GameInfo(const std::wstring &omoDirectory, const std::wstring &gameDirectory)
: m_GameDirectory(gameDirectory), m_OrganizerDirectory(omoDirectory)
{
+ atexit(&cleanup);
+}
+
+
+void GameInfo::cleanup() {
+ delete GameInfo::s_Instance;
+ GameInfo::s_Instance = NULL;
}
diff --git a/src/shared/gameinfo.h b/src/shared/gameinfo.h
index 3e022ef4..14f52f05 100644
--- a/src/shared/gameinfo.h
+++ b/src/shared/gameinfo.h
@@ -176,9 +176,11 @@ private:
static bool identifyGame(const std::wstring &omoDirectory, const std::wstring &searchPath);
std::wstring getSpecialPath(LPCWSTR name) const;
+ static void cleanup();
+
private:
- static GameInfo* s_Instance;
+ static GameInfo *s_Instance;
std::wstring m_MyGamesDirectory;
diff --git a/src/shared/leaktrace.cpp b/src/shared/leaktrace.cpp
index 83ed4fd0..c3721557 100644
--- a/src/shared/leaktrace.cpp
+++ b/src/shared/leaktrace.cpp
@@ -114,6 +114,7 @@ static struct __TraceData {
}
std::map<unsigned long, StackData> m_Traces;
+
} __trace;
diff --git a/src/shared/shared.pro b/src/shared/shared.pro
index ab0bd8a0..992fd7f2 100644
--- a/src/shared/shared.pro
+++ b/src/shared/shared.pro
@@ -13,9 +13,17 @@ CONFIG += staticlib
INCLUDEPATH += ../bsatk "$(BOOSTPATH)"
+
+# only for custom leak detection
+#DEFINES += TRACE_LEAKS
+#LIBS += -lDbgHelp
+
+
CONFIG(debug, debug|release) {
- LIBS += -L$$OUT_PWD/../bsatk/debug
+ LIBS += -L$$OUT_PWD/../bsatk/debug
LIBS += -lDbgHelp
+ QMAKE_CXXFLAGS_DEBUG -= -Zi
+ QMAKE_CXXFLAGS += -Z7
} else {
LIBS += -L$$OUT_PWD/../bsatk/release
}