file.cpp

changeset 55
b08f10e668e5
parent 46
69962c85f717
child 60
961663d05463
--- a/file.cpp	Thu Mar 21 00:37:15 2013 +0200
+++ b/file.cpp	Thu Mar 21 02:45:53 2013 +0200
@@ -425,4 +425,21 @@
 	
 	const ulong ulSpot = g_qWindow->getInsertionPoint ();
 	objects.insert (objects.begin() + ulSpot, obj);
+}
+
+// =============================================================================
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+// =============================================================================
+void OpenFile::forgetObject (LDObject* obj) {
+	// Find the index for the given object
+	ulong ulIndex;
+	for (ulIndex = 0; ulIndex < (ulong)objects.size(); ++ulIndex)
+		if (objects[ulIndex] == obj)
+			break; // found it
+	
+	if (ulIndex >= objects.size ())
+		return; // was not found
+	
+	// Erase it from memory
+	objects.erase (objects.begin() + ulIndex);
 }
\ No newline at end of file

mercurial