Avoid crash on step export

Detach the wxProcess from the chain before closing

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16608
This commit is contained in:
Seth Hillbrand 2024-01-16 13:17:57 -08:00
parent 6f52220741
commit 13544ff975
2 changed files with 14 additions and 3 deletions

View File

@ -54,7 +54,6 @@ public:
~STDSTREAM_THREAD()
{
delete[] m_buffer;
delete m_process;
}
private:
@ -210,10 +209,21 @@ void DIALOG_EXPORT_STEP_LOG::onClose( wxCloseEvent& aEvent )
{
m_msgQueue.Post( STATE_MESSAGE::REQUEST_EXIT );
m_stdioThread->Wait();
delete m_stdioThread;
m_process->DeletePendingEvents();
m_process->Unlink();
m_process->CloseOutput();
m_process->Detach();
m_stdioThread->Delete();
}
Destroy();
aEvent.Skip();
}
DIALOG_EXPORT_STEP_LOG::~DIALOG_EXPORT_STEP_LOG()
{
delete m_stdioThread;
}

View File

@ -41,6 +41,7 @@ public:
};
DIALOG_EXPORT_STEP_LOG( wxWindow* aParent, wxString aStepCmd );
~DIALOG_EXPORT_STEP_LOG() override;
private:
void appendMessage( const wxString& aMessage );