Skip to content

Commit 481d831

Browse files
committed
Fix Shutdown Handling
Tighten process execution shutdown handling by treating a missing shutdown flag as a non-cancelled run instead of dereferencing it, which avoids an unnecessary early exit path. * Terminal pane * Process utilities **Generated by CodeLite** Signed-off-by: Eran Ifrah <eran@codelite.org>
1 parent 4f5cf9a commit 481d831

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

CodeLite/procutils.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,9 @@ int ProcUtils::SafeExecuteCommand(const wxString& command,
511511
if (!err.empty()) {
512512
accumlated_output += err;
513513
}
514+
if (shutdown_flag == nullptr) {
515+
return true;
516+
}
514517
return !shutdown_flag->load();
515518
};
516519

Plugin/wxTerminalCtrl/clBuiltinTerminalPane.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ void clBuiltinTerminalPane::OnNew(wxCommandEvent& event)
149149
V.push_back(wxAcceleratorEntry{wxACCEL_RAW_CTRL, (int)'E', XRCID("Ctrl_ID_end_of_line")});
150150

151151
wxAcceleratorTable accel_table(V.size(), V.data());
152-
153152
ctrl->SetAcceleratorTable(accel_table);
153+
154154
ctrl->Bind(wxEVT_MENU, &clBuiltinTerminalPane::OnCtrlR, this, XRCID("Ctrl_ID_command"));
155155
ctrl->Bind(wxEVT_MENU, &clBuiltinTerminalPane::OnCtrlU, this, XRCID("Ctrl_ID_clear_line"));
156156
ctrl->Bind(wxEVT_MENU, &clBuiltinTerminalPane::OnCtrlL, this, XRCID("Ctrl_ID_clear_screen"));
@@ -293,6 +293,7 @@ void clBuiltinTerminalPane::OnCtrlR(wxCommandEvent& e)
293293
CHECK_IF_CAN_HANDLE(e);
294294
terminal->SendCtrlR();
295295
}
296+
296297
void clBuiltinTerminalPane::OnCtrlU(wxCommandEvent& e)
297298
{
298299
CHECK_IF_CAN_HANDLE(e);
@@ -353,3 +354,5 @@ void clBuiltinTerminalPane::OnCtrlE(wxCommandEvent& e)
353354
terminal->SendCtrlE();
354355
}
355356
#undef CHECK_IF_CAN_HANDLE
357+
358+
void clBuiltinTerminalPane::OnInitDone(wxCommandEvent& e) { e.Skip(); }

Plugin/wxTerminalCtrl/clBuiltinTerminalPane.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class WXDLLIMPEXP_SDK clBuiltinTerminalPane : public wxPanel
2020

2121
protected:
2222
void OnWorkspaceLoaded(clWorkspaceEvent& event);
23+
void OnInitDone(wxCommandEvent& e);
2324
void OnPageChanged(wxBookCtrlEvent& event);
2425
void OnSetTitle(wxTerminalEvent& event);
2526
void OnNew(wxCommandEvent& event);

0 commit comments

Comments
 (0)