Open
Description
Is your feature request related to a problem? Please describe.
"I'm always frustrated when" an async task raises an exception, due to a programming mistake, and then is never cleaned up.
For instance, the exception
unrecognized selector sent to instance 0xbdfcc9ec389956ee
Exception ignored on calling ctypes callback function:
<function CFTimerHandle._cf_timer_callback..cf_timer_callback at 0x1264c4a60>
results in every new attempt at launching an async task throwing an error:
RuntimeError: Cannot enter into task <Task pending name='Task-3' coro=<...> while
another task <Task pending name='Task-38' coro=<handler_with_cleanup() running at
Contents/Resources/app_packages/toga/handlers.py:25>> is being executed.
Describe the solution you'd like
Would it be possible to somehow clean up the async timer event after an ObjC exception? I have no idea if this is even feasible and how to approach that. But it would certainly make the Cocoa event loop integration more robust.