Due to usage of background tasks it is possible for a task to start when project is being closed. This leads to confusing exceptions thrown by places which are already disposed.
Previous attempt to bind lifecycle to disposing was not successful because components are disposed top-down (starting from Project). It also introduced very complicated lifecycle handling.
Instead handling can be simplified:
do not start tasks if component is already disposed
if exception is thrown by task, check Project state and either report error (Project is not disposing) or warning (disposing is ongoing)
Due to usage of background tasks it is possible for a task to start when project is being closed. This leads to confusing exceptions thrown by places which are already disposed.
Previous attempt to bind lifecycle to disposing was not successful because components are disposed top-down (starting from Project). It also introduced very complicated lifecycle handling.
Instead handling can be simplified: