Skip to content

Commit

Permalink
indigo-core: fixed CML saver (avoid memory leak)
Browse files Browse the repository at this point in the history
  • Loading branch information
IuriiPuzanov committed Apr 18, 2016
1 parent dd10300 commit ae90b6c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion molecule/src/molecule_cml_saver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void MoleculeCmlSaver::saveMolecule (Molecule &mol)
{
LocaleGuard locale_guard;
int i;
_doc = new TiXmlDocument();
AutoPtr<TiXmlDocument> _doc(new TiXmlDocument());
_root = 0;

_mol = &mol;
Expand Down Expand Up @@ -243,6 +243,7 @@ void MoleculeCmlSaver::saveMolecule (Molecule &mol)
TiXmlPrinter printer;
_doc->Accept(&printer);
_output.printf("%s", printer.CStr());
_doc.release();
}

void MoleculeCmlSaver::_addSgroupElement (TiXmlElement *molecule, SGroup &sgroup)
Expand Down

0 comments on commit ae90b6c

Please sign in to comment.