webengine/osswebengine/JavaScriptCore/kjs/list.cpp
changeset 5 10e98eab6f85
parent 0 dd21522fd290
--- a/webengine/osswebengine/JavaScriptCore/kjs/list.cpp	Fri May 08 08:25:06 2009 +0300
+++ b/webengine/osswebengine/JavaScriptCore/kjs/list.cpp	Fri Jul 03 15:54:40 2009 +0100
@@ -323,10 +323,23 @@
 
     return copy;
 }
+static List* staticEmptyList = 0;
+
+struct listCleaner {
+    ~listCleaner() {
+            delete staticEmptyList;
+            staticEmptyList = 0;
+    }
+};
+
+static listCleaner cleanList;
 
 const List& List::empty()
 {
-    static List* staticEmptyList = new List;
+		if(!staticEmptyList)
+			{
+    	staticEmptyList = new List;
+    	}
     return *staticEmptyList;
 }