Cocos2dx v3.4 Release Mode Error - c++

I'm trying to build my game on release mode using CMake. I disabled DEBUG_MODE and successfully built the project but when I run it I get an error I don't get in debug mode.
Here's the call stack.
KernelBase.dll!763d2f71() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for KernelBase.dll]
[External Code]
> SortingGame.exe!BackgroundBuilder::configureTimeLabel(const cocos2d::Vec2 timeContainerEndPos) Line 236 C++
SortingGame.exe!BackgroundBuilder::configureTimeContainerSprite() Line 226 C++
SortingGame.exe!GameScene::configureTimeContainerSprite() Line 352 C++
SortingGame.exe!GameScene::configureScene() Line 210 C++
SortingGame.exe!GameScene::init() Line 130 C++
SortingGame.exe!GameScene::create() Line 25 C++
SortingGame.exe!LoadingScreen::onKeyPressed(cocos2d::EventKeyboard::KeyCode keyCode, cocos2d::Event * event) Line 168 C++
[External Code]
SortingGame.exe!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, wchar_t * lpCmdLine, int nCmdShow) Line 24 C++
[External Code]
BackgroundBuilder::configureTimeContainerSprite() function gets called only once. If I call BackgroundBuilder::configureTimeContainerSprite() in BackgroundBuilder::BackgroundBuilder() the error doesn't occur in BackgroundBuilder::configureTimeContainerSprite() but in main.cpp file's return Application::getInstance()->run(); line. The error is the same here too.
I get the same error when I build the project with Visual Studio 2013.

I figured out the problem. It appears that there's a problem with the way I pre-load assets into my game. In the TitleScreen::init() I use this function to load assets.
GameManager::getInstance()->getResourceManager()->loadTextures("GameScene", callback);
And here's the implementation for the CocosResourceManager::loadTextures()
void CocosResourceManager::loadTextures(const std::string &sceneName, const std::function<void(std::string sceneName, int loadedAssetCount, int totalAssetCount)> &callback)
{
std::map<std::string, std::string> assets = parseAssetsArray(sceneName);
int totalAsset = assets.size(), loadedAsset = 0;
for (auto value : assets) {
TextureCache::getInstance()->addImage(value.second);
loadedAsset++;
callback(sceneName, loadedAsset, totalAsset);
}
}
When I don't pe-load the assets with that function, there's no crash in release mode. When I pre-load them, I have it with the stack trace I previously posted above. This happens with both TextureCache::getInstance()->addImageAsync(); and TextureCache::getInstance()->addImage();
Am I pre-loading the wrong way? Can anybody explain why this is happening?

Related

i got the 100 errors when include a ntddk.h and wdm.h in my program

enter link description here[2][this image shows the error]
I tried this code for block the process before execution.But i got a 100 errors while import a ntddk.h and wdm.h in c++.How to solve it?
Then i got sme erroe like this expected a ')' in my 14 and 22 line of code.
So what should i do for removing the 100 error?
#include <ntstatus.h>
#include<DbgEng.h>
#include<Windows.h>
#include <ntddk.h>
#include <wdm.h>
int main()
{
PEPROCESS process1;
process1 = IoGetCurrentProcess();
HANDLE ProcessId = PsGetCurrentProcessId();
PS_CREATE_NOTIFY_INFO CreateInfo;
PCREATE_PROCESS_NOTIFY_ROUTINE_EX(process1, ProcessId, CreateInfo);
PCUNICODE_STRING ImageFileName;
NTSTATUS CreationStatus;
CreateInfo.CreationStatus = STATUS_ACCESS_DENIED;
ImageFileName = CreateInfo.ImageFileName;
if (ImageFileName == (PCUNICODE_STRING)L"firefox.exe")
{
NTSTATUS result;
result = PsSetCreateProcessNotifyRoutineEx(PCREATE_PROCESS_NOTIFY_ROUTINE_EX(process1, ProcessId, CreateInfo), FALSE);
if (result)
{
printf("blocked");
}
}
return 0;
}
Then i got sme erroe like this expected a ')' in my 14 and 22 line of code.
PCREATE_PROCESS_NOTIFY_ROUTINE_EX(process1, ProcessId, CreateInfo);
result=PsSetCreateProcessNotifyRoutineEx(PCREATE_PROCESS_NOTIFY_ROUTINE_EX(process1, ProcessId, CreateInfo), FALSE);
this is the link for showing my error
Don't mix SDK and DDK headers/libraries in one executable.
If you write a driver, don't include Windows.h. Driver code is not Win32 code.
If you want to create a process in suspended state from another Win32 process, use CREATE_SUSPENDED process creation flag in CreateProcess() (or a similar) Win32 call.
If you want to deny process creation for a particular process from a driver, check this StackOverflow question for the boilerplate code.

Access violation executing location 0x0000000000000000 after calling Isolate::New()

I can't seem to figure out something getting V8 started up. I have this code:
if (!_V8Initialized)
{
v8::V8::InitializeICU();
v8::V8::InitializeExternalStartupData("x86\\"); // (this loads ok, I checked)
auto platform = v8::platform::CreateDefaultPlatform();
v8::V8::InitializePlatform(platform);
v8::V8::Initialize();
_V8Initialized = true;
}
auto params = Isolate::CreateParams();
params.array_buffer_allocator = ArrayBuffer::Allocator::NewDefaultAllocator();
_Isolate = Isolate::New(params);
But I get this error:
Exception thrown at 0x0000000000000000 in V8.Net.Console.exe:
0xC0000005: Access violation executing location 0x0000000000000000.
v8_libbase.dll!v8::base::OS::Abort() Line 832 C++
v8_libbase.dll!V8_Fatal(const char * file, int line, const char * format, ...) Line 74 C++
v8.dll!v8::internal::SnapshotData::SnapshotData(const v8::internal::Vector snapshot) Line 28 C++
v8.dll!v8::internal::Snapshot::Initialize(v8::internal::Isolate * isolate) Line 43 C++
v8.dll!v8::Isolate::New(const v8::Isolate::CreateParams & params) Line 8237 C++
V8_Net_Proxy_x64.dll!V8EngineProxy::V8EngineProxy(bool enableDebugging, void()() debugMessageDispatcher, int debugPort) Line 89 C++
V8_Net_Proxy_x64.dll!CreateV8EngineProxy(bool enableDebugging, void()() debugMessageDispatcher, int debugPort) Line 19 C++
[Managed to Native Transition]
V8.Net.dll!V8.Net.V8Engine.V8Engine() Line 246 C#
V8.Net.Console.exe!V8.Net.Program.Main(string[] args) Line 31 C#
[Native to Managed Transition]
mscoreei.dll!00007ffdbdd281ad() Unknown
mscoree.dll!00007ffdbddc10ab() Unknown
kernel32.dll!00007ffdd3868364() Unknown
ntdll.dll!00007ffdd5ef70d1() Unknown
It seems to be failing here:
explicit SnapshotData(const Vector<const byte> snapshot)
: SerializedData(const_cast<byte*>(snapshot.begin()), snapshot.length()) {
CHECK(IsSane()); <-- THIS FAILS
}
I followed the source code here (for the most part): https://chromium.googlesource.com/v8/v8/+/branch-heads/4.8/samples/hello-world.cc
... but I'm not sure why it seems I'm getting a null error. I must be missing something...
Nevermind, I always seem to figure things out AFTER posting to SO, lol. It turns out I was loading from the x86 directory and not the x64 directory (which I should have guess given the V8_Net_Proxy_x64.dll! lol).
I was going to delete the question, but I'll leave this here anyhow in case someone else falls into this in the middle of the night half asleep. ;)

QuickFIX and MFC: cannot login using Initiatior.logon() function

I'm developing a GUI application where I try to integrate QuickFIX library into MFC. I have successfully added all the needed libs and includes, however, when I try to connect using the logon() function I am encountering troubles. First of all, the engine starts requiering more fields in the config file, which it doesn't care in a console application. Secondly, after the logon request, I receive "Debug Assertion Failed! Program: C:\Windows\System32\MSVCP120D.DLL File: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xtree
Line: 327
Expression: map/set iterators incompatible".
What I am trying to do is as follows:
I have a menu. If you press "Start" in the menu, I set a bool flag to true. In my OnKickIdle function(the application is dialog based) I check this flag, and if it is set - I start the normal initiation of the SockeInitiator. All is OK until I call the logon() function, and after it's call - the debug assertion is thrown. This is the CallStack output:
msvcp120d.dll!std::_Debug_message(const wchar_t * message, const wchar_t * file, unsigned int line) Line 15 C++
OKKOIN_BOT.exe!std::_Tree_const_iterator > > >::operator==(const std::_Tree_const_iterator > > > & _Right) Line 327 C++
OKKOIN_BOT.exe!std::_Tree_const_iterator > > >::operator!=(const std::_Tree_const_iterator > > > & _Right) Line 341 C++
OKKOIN_BOT.exe!FIX::SocketInitiator::onTimeout(FIX::SocketConnector & __formal) Line 227 C++
OKKOIN_BOT.exe!FIX::SocketInitiator::onStart() Line 93 C++
OKKOIN_BOT.exe!FIX::Initiator::startThread(void * p) Line 286 C++
[External Code]
Have somebody experienced the same issues and tried to integrate QuickFIX into MFC? Thank you so much in advance guys.
Here is also the part of my OnKickIdle() function:
LRESULT COKKOIN_BOTDlg::OnKickIdle(WPARAM wparam, LPARAM lparam)
{
if (b_startFlag)
{
std::string filepath = "quickfix-client.cfg";
FIX::SessionSettings settings(filepath);
Application app(settings);
FIX::FileStoreFactory storefact(settings);
FIX::ScreenLogFactory logfactory(settings);
FIX::SocketInitiator initiator(app, storefact, settings, logfactory);
b_initflag = TRUE;
//initializing the needed variables
initiator.start(); //use poll instead
Sleep(2000);
if (initiator.isLoggedOn())
{
MessageBox(L"Logged On", L"Information", MB_OK | MB_ICONINFORMATION);
}
else
{
MessageBox(L"Not Logged On", L"Information", MB_OK | MB_ICONINFORMATION);
}
}
return FALSE;
}
Finally I found the issue guys. The problem as in MFC itself because it does not support Windows Sockets 2, which is required by QuickFIX. I suppose the question can be closed.

QT application crashes on startup (c++ windows)

I have the source code f a qt application which was written by somebody else who is not with my company anymore.
I managed to compile the code using qt 4.8.4. I found that original version used qt 4.7.3.
When I run application it crashes just after start-up inside one of the qt DLL.
I am developing on windows7 x64, but target is x86. I am using VS 2012 and compiled qt using VS 2012.
Do I need to set anything environment variable for QT to work properly?
Do I need to install any other software (such as opengl or any other library that qt relays on them)?
Edit 1
The stack after crashing is:
QtOpenGLd4.dll!QGLContextPrivate::extensionFuncs(const QGLContext * ctx) Line 467 C++
QtOpenGLd4.dll!qt_resolve_glsl_extensions(QGLContext * ctx) Line 257 C++
QtOpenGLd4.dll!QGLShaderPrivate::create() Line 227 C++
QtOpenGLd4.dll!QGLShader::QGLShader(QFlags<enum QGLShader::ShaderTypeBit> type, const QGLContext * context, QObject * parent) Line 342 C++
QtOpenGLd4.dll!QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext * context) Line 191 C++
QtOpenGLd4.dll!QGLContextGroupResource<QGLEngineSharedShaders>::value(const QGLContext * context) Line 777 C++
QtOpenGLd4.dll!QGLShaderStorage::shadersForThread(const QGLContext * context) Line 63 C++
QtOpenGLd4.dll!QGLEngineSharedShaders::shadersForContext(const QGLContext * context) Line 74 C++
QtOpenGLd4.dll!QGLEngineShaderManager::QGLEngineShaderManager(QGLContext * context) Line 467 C++
QtOpenGLd4.dll!QGL2PaintEngineEx::begin(QPaintDevice * pdev) Line 2150 C++
QtGuid4.dll!QPainter::begin(QPaintDevice * pd) Line 1881 C++
QtGuid4.dll!QPainter::QPainter(QPaintDevice * pd) Line 1508 C++
myapp.exe!SViewer::paintEvent(QPaintEvent * __formal) Line 187 C++
QtGuid4.dll!QWidget::event(QEvent * event) Line 8533 C++
QtOpenGLd4.dll!QGLWidget::event(QEvent * e) Line 4408 C++
QtGuid4.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 4562 C++
QtGuid4.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 4527 C++
QtCored4.dll!QCoreApplication::notifyInternal(QObject * receiver, QEvent * event) Line 946 C++
QtCored4.dll!QCoreApplication::sendSpontaneousEvent(QObject * receiver, QEvent * event) Line 234 C++
QtGuid4.dll!QWidgetPrivate::drawWidget(QPaintDevice * pdev, const QRegion & rgn, const QPoint & offset, int flags, QPainter * sharedPainter, QWidgetBackingStore * backingStore) Line 5598 C++
QtGuid4.dll!QWidgetPrivate::repaint_sys(const QRegion & rgn) Line 1659 C++
QtGuid4.dll!QWidgetPrivate::syncBackingStore() Line 1894 C++
QtGuid4.dll!QWidget::event(QEvent * event) Line 8680 C++
QtOpenGLd4.dll!QGLWidget::event(QEvent * e) Line 4408 C++
QtGuid4.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 4562 C++
QtGuid4.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 4527 C++
QtCored4.dll!QCoreApplication::notifyInternal(QObject * receiver, QEvent * event) Line 946 C++
QtCored4.dll!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) Line 231 C++
QtCored4.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Line 1570 C++
QtCored4.dll!qt_internal_proc(HWND__ * hwnd, unsigned int message, unsigned int wp, long lp) Line 496 C++
user32.dll!75ce62fa() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for user32.dll]
user32.dll!75ce6d3a() Unknown
user32.dll!75ce6ce9() Unknown
user32.dll!75ce77c4() Unknown
user32.dll!75ce788a() Unknown
QtCored4.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 810 C++
QtGuid4.dll!QGuiEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 1204 C++
QtCored4.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 150 C++
QtCored4.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 204 C++
QtGuid4.dll!QDialog::exec() Line 555 C++
myapp.exe!MainWindow::actionWelcomeDialog() Line 1078 C++
myapp.exe!MainWindow::qt_static_metacall(QObject * _o, QMetaObject::Call _c, int _id, void * * _a) Line 92 C++
QtCored4.dll!QMetaCallEvent::placeMetaCall(QObject * object) Line 524 C++
QtCored4.dll!QObject::event(QEvent * e) Line 1194 C++
QtGuid4.dll!QWidget::event(QEvent * event) Line 8845 C++
QtGuid4.dll!QMainWindow::event(QEvent * event) Line 1479 C++
QtGuid4.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 4562 C++
QtGuid4.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 4527 C++
QtCored4.dll!QCoreApplication::notifyInternal(QObject * receiver, QEvent * event) Line 946 C++
QtCored4.dll!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) Line 231 C++
QtCored4.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Line 1570 C++
QtCored4.dll!qt_internal_proc(HWND__ * hwnd, unsigned int message, unsigned int wp, long lp) Line 496 C++
user32.dll!75ce62fa() Unknown
user32.dll!75ce6d3a() Unknown
user32.dll!75ce6ce9() Unknown
user32.dll!75ce77c4() Unknown
user32.dll!75ce788a() Unknown
QtCored4.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 810 C++
QtGuid4.dll!QGuiEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 1204 C++
QtCored4.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 150 C++
QtCored4.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 204 C++
QtCored4.dll!QCoreApplication::exec() Line 1218 C++
QtGuid4.dll!QApplication::exec() Line 3824 C++
myapp.exe!main(int argc, char * * argv) Line 26 C++
myapp.exe!WinMain(HINSTANCE__ * instance, HINSTANCE__ * prevInstance, char * __formal, int cmdShow) Line 131 C++
myapp.exe!__tmainCRTStartup() Line 528 C
myapp.exe!WinMainCRTStartup() Line 377 C
kernel32.dll!758333aa() Unknown
ntdll.dll!77d59ef2() Unknown
ntdll.dll!77d59ec5() Unknown
I had the same problem with my own QT-Application using Qt 4.8.3 with OpenGL.
I found out that the crash is due to the using OpenGL paint engine. The engine type should automatically be set to OnegGL2 if the OpenGL driver reports that it supports OpenGL 2.0. This seems to be failing in my case.
To fix the problem I set the OpenGL preferred paint engine by adding the following code before constructing my QT-Application:
QGL::setPreferredPaintEngine(QPaintEngine::OpenGL);
Okay... here is your laundry list:
Make sure that you are building with the MSVS compiler, and compiling for win32.
If your application is surrounded by dll's built for mingw, or win64, you may have just entered "DLL he**". Make sure that you don't have any dll's sitting right next to your application's exe, or in the working directory (probably your folder that your source is in).
http://msdn.microsoft.com/en-us/library/windows/desktop/ms682586(v=vs.85).aspx#search_order_for_desktop_applications
Now go and check your system and user environment variables. Make sure that there isn't a listing for some Qt folder that you aren't building for.
Also go and make sure that Qt Creator or Visual Studio is pointing that the version of Qt you are building for.
Do a build clean on your project, and rebuild the whole thing. Be sure to read the "Compile Output" and "Build Output" folders.
Try building and running your program in debug. Then also try building and running your program in release. Make note of the application output, and the compile output.
If you are still crashing on startup, go and start putting in debug statements throughout your code to see where it is dying, or break points when you are running you debug version in debug mode. For example: qDebug() << Q_FUNC_INFO; at the top of your main function.
Also when it crashes, make note of the return code. Searching the return code in Google can also tell you a lot about what is going on.
Also check the paths that your program relies on.
Go and check your .pro file for any dependencies that you weren't aware of.
And beyond that you will probably need to give more info to get more help from me. :)
Hope that helps.

C++11 static local variables and threads

Is static local variables safe for a class that creates/uses std::threads?
Because when I use something like this:
logger& logger::get_instance(void)
{
static logger lg;
return lg;
}
And try to exit (force close) the executable, it crashes/exits improperly (somethings the Visual Studio 2012 debugger even crashes).
When I don't do that, the program exits gracefully when i force close.
Here's the stack call when it crashes
ntdll.dll!77c10dbd() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
ntdll.dll!77b7bfdc() Unknown
kernel32.dll!75b55bab() Unknown
> msvcr110d.dll!__crtCreateThreadpoolWait(void (_TP_CALLBACK_INSTANCE *, void *, _TP_WAIT *, unsigned long) * pfnwa, void * pv, _TP_CALLBACK_ENVIRON_V1 * pcbe) Line 569 C
msvcr110d.dll!Concurrency::details::RegisterAsyncWaitAndLoadLibrary(void * waitingEvent, void (_TP_CALLBACK_INSTANCE *, void *, _TP_WAIT *, unsigned long) * callback, void * data) Line 675 C++
msvcr110d.dll!Concurrency::details::ExternalContextBase::PrepareForUse(bool explicitAttach) Line 120 C++
msvcr110d.dll!Concurrency::details::ExternalContextBase::ExternalContextBase(Concurrency::details::SchedulerBase * pScheduler, bool explicitAttach) Line 52 C++
msvcr110d.dll!Concurrency::details::SchedulerBase::GetExternalContext(bool explicitAttach) Line 1579 C++
msvcr110d.dll!Concurrency::details::SchedulerBase::AttachExternalContext(bool explicitAttach) Line 1527 C++
msvcr110d.dll!Concurrency::details::SchedulerBase::CreateContextFromDefaultScheduler() Line 569 C++
msvcr110d.dll!Concurrency::details::SchedulerBase::CurrentContext() Line 402 C++
msvcr110d.dll!Concurrency::details::LockQueueNode::LockQueueNode(unsigned int timeout) Line 616 C++
msvcr110d.dll!Concurrency::critical_section::lock() Line 1017 C++
msvcp110d.dll!mtx_do_lock(_Mtx_internal_imp_t * * mtx, const xtime * target) Line 65 C++
msvcp110d.dll!_Mtx_lock(_Mtx_internal_imp_t * * mtx) Line 144 C++
escobar.exe!std::_Mtx_lockX(_Mtx_internal_imp_t * * _Mtx) Line 68 C++
escobar.exe!std::_Mutex_base::lock() Line 43 C++
escobar.exe!std::unique_lock<std::mutex>::unique_lock<std::mutex>(std::mutex & _Mtx) Line 228 C++
escobar.exe!escobar::utilities::blocking_queue<escobar::logging::log_message *>::interrupt() Line 71 C++
escobar.exe!escobar::logging::log_worker::~log_worker() Line 17 C++
escobar.exe!escobar::logging::log_worker::`scalar deleting destructor'(unsigned int) C++
escobar.exe!escobar::logging::logger::close() Line 72 C++
escobar.exe!escobar::logging::logger::~logger() Line 27 C++
escobar.exe!`escobar::logging::logger::get_instance'::`2'::`dynamic atexit destructor for 'lg''() C++
msvcr110d.dll!doexit(int code, int quick, int retcaller) Line 585 C
msvcr110d.dll!_cexit() Line 410 C
msvcr110d.dll!__CRTDLL_INIT(void * hDllHandle, unsigned long dwReason, void * lpreserved) Line 296 C
msvcr110d.dll!_CRTDLL_INIT(void * hDllHandle, unsigned long dwReason, void * lpreserved) Line 210 C
ntdll.dll!77bb2846() Unknown
ntdll.dll!77bb2893() Unknown
ntdll.dll!77bc09c8() Unknown
ntdll.dll!77bc08ad() Unknown
KernelBase.dll!75525bbb() Unknown
KernelBase.dll!75525c51() Unknown
kernel32.dll!75b58543() Unknown
ntdll.dll!77bbac69() Unknown
ntdll.dll!77bbac3c() Unknown
Here are a couple of the functoin
log_worker::~log_worker(void)
{
this->queue.interrupt();
service.join();
}
void log_worker::run(void)
{
while (true)
{
log_message* msg;
if (this->queue.dequeue(msg) == false)
break;
this->lg->print_log_message(msg);
delete msg;
}
}
bool dequeue(T& item)
{
std::unique_lock<std::mutex> lock(m);
// handles spurious wakeups
while (!this->data_available && !this->interrupted)
cv.wait(lock);
if (this->interrupted)
return false;
item = std::move(this->front());
this->pop();
if (this->empty())
this->data_available = false;
return true;
}
void interrupt(void)
{
std::unique_lock<std::mutex> lock(m);
this->interrupted = true;
cv.notify_all();
printf("notified threads...\n");
}
Looks like you have a detached thread SchedulerBase(could be any scheduled thread which still uses logger) which is still running while your application is stopped and logger is destroyed which caused the crash.
And log_worker is dynamically allocated in the logger class.
You need to make sure all threads who use logger instance are shutdown properly before logger is destroyed
delete log_worker in logger destructor
I simply had to stop deleting things on shutdown. When you close the console using the 'X' button, it's not a proper shutdown, so It's pointless trying to shutdown threads.