I'm trying to catch a signal so I can make our program exit gracefully. SIGABRT happens when we read a bad file, which we can't control. This is a multi-platform program so we need something that works in windows, linux, and mac.
For some reason, when I add a signal_callback_handler like at signal handling example, and run the problem test in Windows, it's still coming up with the abort popup box like we had before. How do I redirect before the popup for abort happens? I want our program to exit gracefully.
//constructor
example::example(const string theString)
{
signal(SIGABRT, signal_callback_handler);
}
void example::signal_callback_handler(int sigNum)
{
//want to handle gracefully here, but it's not getting caught
}
bool example::someMethod()
{
FileHandle.openFile(problemDocument); //this openFile is where the SIGABRT happens
}
Thanks!