Skip to content

Commit

Permalink
fix: actions status don't update when debug finished
Browse files Browse the repository at this point in the history
  • Loading branch information
royqh1979 committed Nov 28, 2024
1 parent 5541535 commit 2eaafae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions RedPandaIDE/debugger/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ bool Debugger::startClient(int compilerSetIndex,
const QString& sourceFile)
{
QMutexLocker locker{&mClientMutex};
if (mClient)
if (mClient!=nullptr)
return false;
mCurrentSourceFile = sourceFile;
Settings::PCompilerSet compilerSet = pSettings->compilerSets().getSet(compilerSetIndex);
Expand Down Expand Up @@ -161,6 +161,8 @@ bool Debugger::startClient(int compilerSetIndex,
mClient->addBinDirs(binDirs);
mClient->addBinDir(pSettings->dirs().appDir());
mClient->setDebuggerPath(debuggerPath);
connect(this, &Debugger::debugEnded, pMainWindow,
QOverload<>::of(&MainWindow::updateEditorActions));
connect(mClient, &QThread::finished,this,&Debugger::cleanUp);
connect(mClient, &QThread::finished,mMemoryModel.get(),&MemoryModel::reset);
connect(mClient, &DebuggerClient::parseFinished,this,&Debugger::syncFinishedParsing,Qt::BlockingQueuedConnection);
Expand Down Expand Up @@ -272,13 +274,12 @@ void Debugger::cleanUp()

mBreakpointModel->invalidateAllBreakpointNumbers();

pMainWindow->updateEditorActions();

//stop debugger
mClient->stopDebug();
mClient->deleteLater();
mClient = nullptr;
}
emit debugEnded();
}

void Debugger::updateRegisterNames(const QStringList &registerNames)
Expand Down
1 change: 1 addition & 0 deletions RedPandaIDE/debugger/debugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ class Debugger : public QObject
void evalValueReady(const QString& s);
void memoryExamineReady(const QStringList& s);
void localsReady(const QStringList& s);
void debugEnded();
public slots:
void stop();
void refreshAll();
Expand Down

0 comments on commit 2eaafae

Please sign in to comment.