P-McG / BT-MatML-Editor

Material Text Editor for the xml MatML schema (https://www.matml.org)
GNU General Public License v3.0
6 stars 0 forks source link

Selecting new, while already existing doc, causes memory leak #28

Closed P-McG closed 2 years ago

P-McG commented 2 years ago

Traced down the memory leak to the validators in the GUI classes. The validator was created from the heap twice.

m_DataTextCtrlValidator = new DataTextCtrlValidator(MatMLTreeCtrl, m_ValidationNewLineRemovalCheckBox);

changed to

if(!m_DataTextCtrlValidator) m_DataTextCtrlValidator = new DataTextCtrlValidator(MatMLTreeCtrl, m_ValidationNewLineRemovalCheckBox);

P-McG commented 2 years ago

[fixed]