diff --git a/src/common/docview.cpp b/src/common/docview.cpp index ef47161018..988fc0b7d5 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -1100,6 +1100,7 @@ wxDocument *wxDocManager::CreateDocument(const wxString& path, long flags) { if (!CloseDocument(docToClose, FALSE)) { + delete[] templates; return NULL; } }