Skip to content
  • Eric Jiang's avatar
    Auto-call taskManager.taskDone() when run() ends · fced1a0b
    Eric Jiang authored and Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle committed
    Create AbstractTaskDone at the beginning of run() so that it is
    destroyed when it goes out of scope (i.e. run() finishes). When
    AbstractTaskDone is destroyed, it calls
    
    pCore->taskManager.taskDone(...)
    
    so that we don't need to manually insert calls to taskDone() before
    every return statement. By calling it at the very end of the function,
    we ensure that taskDone() is not called too early, which can delete the
    AbstractTask before it actually finishes.
    fced1a0b