I beg to differ. Knowing it not to work doesn't mean it isn't still a bug when it doesn't . Besides, as this thread shows some people expect it to actually work (As did I the first time I pushed the Big Red ButtonTM).
It works, and it is no bug. What Code::Blocks does is perfectly correct and legal. It is just that
SIGTERM (or signals in general) does not exist on Windows.
So what the abort button
effectively does is stop the run queue, thus no more processes are launched. Everything works as it should, really.
According to
The wxWidgets documentation is rubbish, bluntly said. It often makes claims which are not in concordance with reality. For example, the documentation encourages to use
wxMilliSleep instead of
usleep(3) because it is MT safe. What
wxMilliSleep really does is multiply by 1000 and call the platform-dependent
usleep,
Sleep, or
nanosleep function. In my humble opinion, a multiply does not greatly increase thread safety.
The issue with
wxKill is similar. While it really sends signals on Unix, what
wxKill does on Windows is this:
- If signal is SIGKILL, it calls
TerminateProcess - If signal is SIGNONE, the function returns immediately
- If signal is *anything* except the two above, it posts
WM_QUIT to any windows it can find
You could argue that
WM_QUIT kind of simulates a
SIGTERM for Windows programs, but that is really not the case. SIGTERM is meant to say "please go away, gracefully", and an application is not even required to actually follow it.
WM_QUIT just ends the message loop, and the program exits without much opportunity for cleanup.
Using
WM_CLOSE instead would be an improvement at least insofar as the program is not just knocked out of its message loop, but it would of course still not work for non-GUI programs.
Edit: typo