Fix a potential crash when exiting the map editor.

git-svn-id: http://corsix-th.googlecode.com/svn/trunk@2417 c39591fa-788f-11de-a72b-d90af8dea425