(svn r13161) -Fix: free the blitter list when the last blitter is removed.
authorglx
Sun, 18 May 2008 12:47:08 +0000
changeset 9294 8e74039d3ca0
parent 9293 96e818608056
child 9295 ee2d463700e3
(svn r13161) -Fix: free the blitter list when the last blitter is removed.
src/blitter/factory.hpp
--- a/src/blitter/factory.hpp	Sun May 18 12:40:38 2008 +0000
+++ b/src/blitter/factory.hpp	Sun May 18 12:47:08 2008 +0000
@@ -56,7 +56,13 @@
 		name(NULL)
 	{}
 
-	virtual ~BlitterFactoryBase() { if (this->name != NULL) GetBlitters().erase(this->name); free(this->name); }
+	virtual ~BlitterFactoryBase()
+	{
+		if (this->name == NULL) return;
+		GetBlitters().erase(this->name);
+		if (GetBlitters().empty()) delete &GetBlitters();
+		free(this->name);
+	}
 
 	/**
 	 * Find the requested blitter and return his class.