webengine/osswebengine/WebCore/platform/MimeTypeRegistry.cpp
changeset 5 10e98eab6f85
parent 0 dd21522fd290
child 10 a359256acfc6
--- a/webengine/osswebengine/WebCore/platform/MimeTypeRegistry.cpp	Fri May 08 08:25:06 2009 +0300
+++ b/webengine/osswebengine/WebCore/platform/MimeTypeRegistry.cpp	Fri Jul 03 15:54:40 2009 +0100
@@ -44,7 +44,28 @@
 static WTF::HashSet<String>* supportedImageResourceMIMETypes;
 static WTF::HashSet<String>* supportedImageMIMETypes;
 static WTF::HashSet<String>* supportedNonImageMIMETypes;
-    
+
+struct cleanupMimeTypes {
+    ~cleanupMimeTypes() {
+        if( supportedImageResourceMIMETypes ) {
+            supportedImageResourceMIMETypes->clear();
+            delete supportedImageResourceMIMETypes;
+            supportedImageResourceMIMETypes = 0;
+        }
+        if( supportedImageMIMETypes ) {
+            supportedImageMIMETypes->clear();
+            delete supportedImageMIMETypes;
+            supportedImageMIMETypes = 0;
+        }
+        if( supportedNonImageMIMETypes ) {
+            supportedNonImageMIMETypes->clear();
+            delete supportedNonImageMIMETypes;
+            supportedNonImageMIMETypes = 0;
+        }
+    }
+};
+struct cleanupMimeTypes cleanMimeTypes;
+
 #if PLATFORM(CG)
 extern String getMIMETypeForUTI(const String& uti);
 #endif