mirror of
https://github.com/sipeed/MaixCDK.git
synced 2026-09-10 21:59:54 -05:00
* use a new api to catch SIGINT
This commit is contained in:
@@ -26,8 +26,8 @@ int _main(int argc, char* argv[])
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
// Catch SIGINT signal(e.g. Ctrl + C), and set exit flag to true.
|
||||
signal(SIGINT, [](int sig){ app::set_exit_flag(true); });
|
||||
// Catch signal and process
|
||||
sys::register_default_signal_handle();
|
||||
|
||||
// Use CATCH_EXCEPTION_RUN_RETURN to catch exception,
|
||||
// if we don't catch exception, when program throw exception, the objects will not be destructed.
|
||||
|
||||
Reference in New Issue
Block a user