1
0
Fork 0

GUI: added a safeguard in the bridge for when GUI messages are sent after the GUI was closed (this could cause 'random' crashes that were just programming errors in a completely different place)

This commit is contained in:
Mr. eXoDia 2015-07-14 01:23:01 +02:00
parent 8ff5012cd5
commit b232430d23
4 changed files with 14 additions and 0 deletions

View File

@ -20,6 +20,7 @@ Bridge::Bridge(QObject* parent) : QObject(parent)
referenceManager = 0;
bridgeResult = 0;
hasBridgeResult = false;
dbgStopped = false;
}
Bridge::~Bridge()
@ -68,12 +69,19 @@ void Bridge::emitMenuAddToList(QWidget* parent, QMenu* menu, int hMenu, int hPar
result.Wait();
}
void Bridge::setDbgStopped()
{
dbgStopped = true;
}
/************************************************************************************
Message processing
************************************************************************************/
void* Bridge::processMessage(GUIMSG type, void* param1, void* param2)
{
if(dbgStopped) //there can be no more messages if the debugger stopped = BUG
__debugbreak();
switch(type)
{
case GUI_DISASSEMBLE_AT:

View File

@ -35,6 +35,7 @@ public:
//helper functions
void emitLoadSourceFile(const QString path, int line = 0, int selection = 0);
void emitMenuAddToList(QWidget* parent, QMenu* menu, int hMenu, int hParentMenu = -1);
void setDbgStopped();
//Public variables
void* winId;
@ -113,6 +114,7 @@ private:
QMutex* mBridgeMutex;
int_t bridgeResult;
volatile bool hasBridgeResult;
volatile bool dbgStopped;
};
#endif // BRIDGE_H

View File

@ -614,10 +614,12 @@ void SettingsDialog::on_chkTabBetweenMnemonicAndArguments_stateChanged(int arg1)
void SettingsDialog::on_editSymbolStore_textEdited(const QString & arg1)
{
Q_UNUSED(arg1);
settings.miscSymbolStore = true;
}
void SettingsDialog::on_editSymbolCache_textEdited(const QString & arg1)
{
Q_UNUSED(arg1);
settings.miscSymbolCache = true;
}

View File

@ -1,8 +1,10 @@
#include "MainWindowCloseThread.h"
#include "NewTypes.h"
#include "Bridge.h"
void MainWindowCloseThread::run()
{
DbgExit();
Bridge::getBridge()->setDbgStopped();
emit canClose();
}