Fixed TaskSchduler not releasing memory and handles