Skip to content

Commit

Permalink
Try harder to kill a no-more-used maxima
Browse files Browse the repository at this point in the history
For #1922
  • Loading branch information
gunterkoenigsmann committed May 30, 2024
1 parent 209f2f3 commit 98d5580
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/wxMaxima.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2868,8 +2868,14 @@ void wxMaxima::KillMaxima(bool logMessage) {
m_CWD.Clear();
QuestionAnswered();
if(m_maximaProcess)
m_maximaProcess->Detach();
m_maximaProcess = NULL;
{
// If maxima no more has a stdout it should automatically close
m_maximaProcess->CloseOutput();
// Tell wxWidgets that we are no more interested in "process exited" signals
// from our maxima process
m_maximaProcess->Detach();
m_maximaProcess = NULL;
}
m_maximaStdout = NULL;
m_maximaStderr = NULL;
m_client.reset();
Expand All @@ -2878,6 +2884,7 @@ void wxMaxima::KillMaxima(bool logMessage) {
if (m_pid > 0) {
// wxProcess::kill will fail on MSW. Something with a console.
wxLogNull logNull;
wxProcess::Kill(m_pid, wxSIGTERM, wxKILL_CHILDREN);
if (wxProcess::Kill(m_pid, wxSIGKILL, wxKILL_CHILDREN) != wxKILL_OK) {
if(wxProcess::Kill(m_pid, wxSIGKILL) != wxKILL_OK) {
wxKillError wxKillError_result;
Expand Down

0 comments on commit 98d5580

Please sign in to comment.