"Task" class has a virtual function called "cleanup", which intended to allocate resources the current task keeps. The calling of the base "cleanup" function might cause a problem, cuz it calls "cleanup" for all current subtasks. If any of these subtasks already was destroyed, a crash will happen. It's possible if, for example, "cleanup" was called from the destructor.
We don't have a good solution for it now, so, it's necessary to discuss this question.