Fixed a crash due to a memory leak.