the list tasks will clear when the list is garbage collected. you don't show usage, but if you have no other references, the list will be released when it goes out of scope.
but if this code was in main, it would not leave scope and never get cleared (program exit does not do a garbage collect).