Fixed the memory leak in TextMap.cpp