diff --git a/lib-api.cpp b/lib-api.cpp index 2a0a92e..4385088 100644 --- a/lib-api.cpp +++ b/lib-api.cpp @@ -235,6 +235,7 @@ void locoAcquiredGotFunc(LocoInfo locoInfo, TrkAcquiredCallback acquired, void * if (acquired != nullptr) acquired(&lib.xn, locoInfo); + // When >O0, segfault happens in the return below (don't know why). } void locoAcquired(LocoAddr addr, TrkAcquiredCallback acquired, LibStdCallback err, diff --git a/xn.pro b/xn.pro index 485f073..2d0aebb 100644 --- a/xn.pro +++ b/xn.pro @@ -55,3 +55,8 @@ DEFINES += "VERSION_MAJOR=$$VERSION_MAJOR" \ #Target version VERSION = $${VERSION_MAJOR}.$${VERSION_MINOR} DEFINES += "VERSION=\\\"$${VERSION}\\\"" + + +#When >=O1, segfault happens in lib-api.cpp +QMAKE_CXXFLAGS_RELEASE -= -O2 +QMAKE_CXXFLAGS_RELEASE += -O0