I have ubuntu 20.04 OS with wxWidgets 3.0.5. I have a custom Process class (inherits from wxProcess) with OnTerminate() function overridden. When I kill a process associated with an instant of MyProcess class with MyProcess::Kill(), according to the documentation of the wxProcess::OnTerminate():
https://docs.wxwidgets.org/3.0/classwx_ ... 4cbb72a172
the OnTerminate() function should not be called. But in my case it is.
I want to know, if this should not happen at all - mistake is in my code, or if this is an expected behavior. If it is, then under which circumstances is the OnTerminate() launched, when the process is killed.
Additinal info:
I launch the command asynchronously with wxExecute("a.out", wxEXEC_ASYNC | wxEXEC_MAKE_GROUP_LEADER, myProcess);
The program a.out has this implementation:
Code: Select all
#include <iostream>
int main(int argc, char *argv[]){
int k;
std::cout << "Narg = " << argc - 1 << std::endl;
for(k = 1; k < argc; ++k){
std::cout << argv[k] << std::endl;
}
std::cerr << "Fail";
while(true){
}
return 127;
}
Thanks