Commit 37c98f89 authored by hjk's avatar hjk
Browse files

debugger: fix crash in memory view when data arrives after view has been closed

parent a0a4b3a3
......@@ -81,7 +81,8 @@ MemoryViewAgent::MemoryViewAgent(DebuggerManager *manager, const QString &addr)
MemoryViewAgent::~MemoryViewAgent()
{
m_editor->deleteLater();
if (m_editor)
m_editor->deleteLater();
}
void MemoryViewAgent::init(quint64 addr)
......@@ -101,13 +102,15 @@ void MemoryViewAgent::init(quint64 addr)
void MemoryViewAgent::fetchLazyData(quint64 block, bool sync)
{
Q_UNUSED(sync); // FIXME: needed support for incremental searching
m_engine->fetchMemory(this, BinBlockSize * block, BinBlockSize);
if (m_engine)
m_engine->fetchMemory(this, BinBlockSize * block, BinBlockSize);
}
void MemoryViewAgent::addLazyData(quint64 addr, const QByteArray &ba)
{
QMetaObject::invokeMethod(m_editor->widget(), "addLazyData",
Q_ARG(quint64, addr / BinBlockSize), Q_ARG(QByteArray, ba));
if (m_editor && m_editor->widget())
QMetaObject::invokeMethod(m_editor->widget(), "addLazyData",
Q_ARG(quint64, addr / BinBlockSize), Q_ARG(QByteArray, ba));
}
......@@ -206,6 +209,9 @@ void DisassemblerViewAgent::setContents(const QString &contents)
using namespace Core;
using namespace TextEditor;
if (!d->editor)
return;
QPlainTextEdit *plainTextEdit = 0;
EditorManager *editorManager = EditorManager::instance();
if (!d->editor) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment