commit 08a625d3
Ensure that the session has been rolled back before deleting it.
Changed files
| M | src/Makefile before |
| M | src/db/Db2CppDb.cpp before |
diff --git a/src/Makefile b/src/Makefile
index 960b3c1..a0f4fe1 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -12,7 +12,7 @@ CXX=$(CROSS)g++
endif
BASE_LIBS=-lgcrypt -lboost_program_options -lgpg-error
-BASE_CFLAGS=-c -g -O2 -Wall -std=c++11
+BASE_CFLAGS=-c -g -O1 -Wall -std=c++11
-include Makefile.local
diff --git a/src/db/Db2CppDb.cpp b/src/db/Db2CppDb.cpp
index 0a5b496..29156b7 100644
--- a/src/db/Db2CppDb.cpp
+++ b/src/db/Db2CppDb.cpp
@@ -106,8 +106,8 @@ void Db2CppDb::createTables()
void Db2CppDb::startGame(int gametype, const string &mapname, const string &basegame, const string &servername, const OaStatStruct &oss)
{
- sql = shared_ptr<cppdb::session>(new cppdb::session(connectstring));
commitlock = nullptr;
+ sql = shared_ptr<cppdb::session>(new cppdb::session(connectstring));
commitlock = shared_ptr<transaction>(new transaction(*sql));
Rollback(); //in case there was some garbage that could be comitted (like warmup or an unfinished game)
SetOk(true);