webengine/osswebengine/WebCore/css/MediaFeatureNames.cpp
changeset 10 a359256acfc6
parent 0 dd21522fd290
--- a/webengine/osswebengine/WebCore/css/MediaFeatureNames.cpp	Fri Jul 03 15:54:40 2009 +0100
+++ b/webengine/osswebengine/WebCore/css/MediaFeatureNames.cpp	Thu Aug 27 07:44:59 2009 +0300
@@ -37,9 +37,10 @@
 CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(DEFINE_MEDIAFEATURE_GLOBAL)
 #undef DEFINE_MEDIAFEATURE_GLOBAL
 
+static bool initialized;
+
 void init()
 {
-    static bool initialized;
     if (!initialized) {
        // Use placement new to initialize the globals.
 
@@ -51,5 +52,18 @@
     }
 }
 
+void remove()
+{
+    if( initialized ) {
+        #define DESTROY_GLOBAL(name, str) delete ((AtomicString*)&name##MediaFeature)->impl();
+        CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(DESTROY_GLOBAL)
+        #undef DESTROY_GLOBAL
+        AtomicString::remove();
+
+        initialized = false;
+    }
+
+} //remove()
+
 } // namespace MediaFeatureNames
 } // namespace WebCore