Fixed memory leak on 10.6