src/ldDocument.cc

changeset 656
2a1c204df14d
parent 655
b376645315ab
child 662
2f1bd9112408
child 707
c89b58ba266b
equal deleted inserted replaced
655:b376645315ab 656:2a1c204df14d
1149 // 1149 //
1150 // Close all documents we don't need anymore 1150 // Close all documents we don't need anymore
1151 // 1151 //
1152 void LDDocument::closeUnused() 1152 void LDDocument::closeUnused()
1153 { 1153 {
1154 for (LDDocument* file : g_loadedFiles) 1154 for (int i = 0; i < g_loadedFiles.size(); ++i)
1155 {
1156 LDDocument* file = g_loadedFiles[i];
1157
1155 if (file->isImplicit() && file->references().isEmpty()) 1158 if (file->isImplicit() && file->references().isEmpty())
1156 delete file; 1159 delete g_loadedFiles[i--];
1160 }
1157 } 1161 }
1158 1162
1159 // ============================================================================= 1163 // =============================================================================
1160 // 1164 //
1161 LDObject* LDDocument::getObject (int pos) const 1165 LDObject* LDDocument::getObject (int pos) const

mercurial