File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 55
66def force_exit ():
77 print ("Force exit now" )
8- _maix .util .do_exit_function ()
98 sys .exit (1 )
109
1110def signal_handle (signum , frame ):
1211 _maix .app .set_exit_flag (True )
1312 signal .signal (signal .SIGINT , signal .SIG_DFL )
14-
13+ signal .signal (signal .SIGILL , signal .SIG_DFL )
14+ signal .signal (signal .SIGABRT , signal .SIG_DFL )
1515 # set exit flag and wait force_exit_timeout seconds, then force exit
1616 t = threading .Timer (force_exit_timeout , force_exit )
1717 t .daemon = True
1818 t .start ()
19-
19+ _maix . util . do_exit_function ()
2020
2121def register_signal_handle ():
22- signal .signal (signal .SIGINT , signal_handle )
22+ signal .signal (signal .SIGINT , signal_handle )
23+ signal .signal (signal .SIGILL , signal_handle )
24+ signal .signal (signal .SIGABRT , signal_handle )
Original file line number Diff line number Diff line change 22
33import struct
44from maix import image
5- from maix import time
5+ from maix import app
66from maix .camera import Camera
77from maix .display import Display
88from maix .touchscreen import TouchScreen
@@ -231,7 +231,8 @@ def find_apriltags(img):
231231 return True
232232 else :
233233 return False
234- while 1 :
234+
235+ while not app .need_exit ():
235236 img = cam .read ()
236237 if img :
237238 res = False
You can’t perform that action at this time.
0 commit comments