Skip to content

Commit f851d63

Browse files
andyclaude
andcommitted
WxFeedback: stop and delete its one-shot timer on destruction; default constructor initialises its pointers
Same shape as the PlaybackControl timer crash fixed for #217: a pending tick is delivered to a freed handler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PFPK14wBcLD1s4dYUowpP4
1 parent f71b4cc commit f851d63

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎src/wxgui/wxtools/WxFeedback.C‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ WxFeedback* WxFeedback::p_feedback = (WxFeedback*)0;
5656
*/
5757
WxFeedback::WxFeedback( ) : WxFeedbackGUI()
5858
{
59+
p_timer = 0;
60+
p_textMenu = 0;
5961
}
6062

6163

@@ -137,6 +139,11 @@ WxFeedback::WxFeedback( wxWindow* parent, wxWindowID id,
137139
*/
138140
WxFeedback::~WxFeedback()
139141
{
142+
// A pending one-shot tick would otherwise be delivered to a freed handler.
143+
if (p_timer) {
144+
p_timer->Stop();
145+
delete p_timer;
146+
}
140147
delete p_textMenu;
141148
}
142149

0 commit comments

Comments
 (0)