1
0
Fork 0

Stop tracing when closing trace file

This commit is contained in:
torusrxxx 2018-08-21 12:40:41 +08:00 committed by Duncan Ogilvie
parent c5830e5c26
commit b3b7ceef3e
1 changed files with 4 additions and 0 deletions

View File

@ -919,6 +919,8 @@ void TraceBrowser::toggleRunTraceSlot()
void TraceBrowser::closeFileSlot()
{
if(DbgValFromString("tr.runtraceenabled()") == 1)
DbgCmdExec("StopRunTrace");
mTraceFile->Close();
delete mTraceFile;
mTraceFile = nullptr;
@ -930,6 +932,8 @@ void TraceBrowser::closeDeleteSlot()
QMessageBox msgbox(QMessageBox::Critical, tr("Close and delete"), tr("Are you really going to delete this file?"), QMessageBox::Yes | QMessageBox::Cancel, this);
if(msgbox.exec() == QMessageBox::Yes)
{
if(DbgValFromString("tr.runtraceenabled()") == 1)
DbgCmdExecDirect("StopRunTrace");
if(mTraceFile->Delete() == false)
SimpleErrorBox(this, tr("Error"), "del error");
delete mTraceFile;