Merge ../ldforge into gl

Sun, 06 Apr 2014 01:40:04 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Sun, 06 Apr 2014 01:40:04 +0300
changeset 707
c89b58ba266b
parent 706
d79083b9f74d (current diff)
parent 656
2a1c204df14d (diff)
child 708
3155f2c05f89

Merge ../ldforge into gl

src/ldDocument.cc file | annotate | diff | comparison | revisions
--- a/src/ldDocument.cc	Sat Mar 29 05:38:03 2014 +0200
+++ b/src/ldDocument.cc	Sun Apr 06 01:40:04 2014 +0300
@@ -1154,9 +1154,13 @@
 //
 void LDDocument::closeUnused()
 {
-	for (LDDocument* file : g_loadedFiles)
+	for (int i = 0; i < g_loadedFiles.size(); ++i)
+	{
+		LDDocument* file = g_loadedFiles[i];
+
 		if (file->isImplicit() && file->references().isEmpty())
-			delete file;
+			delete g_loadedFiles[i--];
+	}
 }
 
 // =============================================================================

mercurial