Fixed memory leak on resume.