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:
parent
8ff5012cd5
commit
b232430d23
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
#include "MainWindowCloseThread.h"
|
||||
#include "NewTypes.h"
|
||||
#include "Bridge.h"
|
||||
|
||||
void MainWindowCloseThread::run()
|
||||
{
|
||||
DbgExit();
|
||||
Bridge::getBridge()->setDbgStopped();
|
||||
emit canClose();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue