Memory leak due to bad destroy sequence