Revert "Fix memory leak in ManageApplication"

This reverts commit d2baa74aefb5d8b79fd0e715dd35716f9ef41801.