Changes in src/moleculelist.cpp [46d958:24a5e0]
- File:
-
- 1 edited
-
src/moleculelist.cpp (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/moleculelist.cpp
r46d958 r24a5e0 7 7 #include <cstring> 8 8 9 #include "World.hpp" 9 10 #include "atom.hpp" 10 11 #include "bond.hpp" … … 24 25 /** Constructor for MoleculeListClass. 25 26 */ 26 MoleculeListClass::MoleculeListClass() 27 MoleculeListClass::MoleculeListClass(World *_world) : 28 world(_world) 27 29 { 28 30 // empty lists … … 38 40 for (MoleculeList::iterator ListRunner = ListOfMolecules.begin(); ListRunner != ListOfMolecules.end(); ListRunner++) { 39 41 Log() << Verbose(4) << "ListOfMolecules: Freeing " << *ListRunner << "." << endl; 40 delete(*ListRunner);42 world->destroyMolecule(*ListRunner); 41 43 } 42 44 Log() << Verbose(4) << "Freeing ListOfMolecules." << endl; … … 137 139 * \param *out output stream 138 140 */ 139 void MoleculeListClass::Enumerate(o fstream *out)141 void MoleculeListClass::Enumerate(ostream *out) 140 142 { 141 143 element* Elemental = NULL; … … 213 215 // remove src 214 216 ListOfMolecules.remove(srcmol); 215 delete(srcmol);217 World::get()->destroyMolecule(srcmol); 216 218 return true; 217 219 }; … … 748 750 void MoleculeListClass::DissectMoleculeIntoConnectedSubgraphs(const periodentafel * const periode, config * const configuration) 749 751 { 750 molecule *mol = new molecule(periode);752 molecule *mol = World::get()->createMolecule(); 751 753 atom *Walker = NULL; 752 754 atom *Advancer = NULL; … … 773 775 } 774 776 // remove the molecule 775 delete(*MolRunner);777 World::get()->destroyMolecule(*MolRunner); 776 778 ListOfMolecules.erase(MolRunner); 777 779 } … … 795 797 molecule **molecules = Malloc<molecule *>(MolCount, "config::Load() - **molecules"); 796 798 for (int i=0;i<MolCount;i++) { 797 molecules[i] = (molecule*) new molecule(mol->elemente);799 molecules[i] = World::get()->createMolecule(); 798 800 molecules[i]->ActiveFlag = true; 799 801 strncpy(molecules[i]->name, mol->name, MAXSTRINGSIZE); … … 893 895 OBSERVE; 894 896 molecule *mol = NULL; 895 mol = new molecule(periode);897 mol = World::get()->createMolecule(); 896 898 insert(mol); 897 899 }; … … 902 904 char filename[MAXSTRINGSIZE]; 903 905 Log() << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl; 904 mol = new molecule(periode);906 mol = World::get()->createMolecule(); 905 907 do { 906 908 Log() << Verbose(0) << "Enter file name: "; … … 960 962 mol = *ListRunner; 961 963 ListOfMolecules.erase(ListRunner); 962 delete(mol);964 World::get()->destroyMolecule(mol); 963 965 break; 964 966 } … … 1007 1009 // remove the leaf itself 1008 1010 if (Leaf != NULL) { 1009 delete(Leaf);1011 World::get()->destroyMolecule(Leaf); 1010 1012 Leaf = NULL; 1011 1013 }
Note:
See TracChangeset
for help on using the changeset viewer.
