delete taskp before taskp->SetInvalid() done.