Fix memory leak that is caused by not destroying the pull sampling object