2009-01-20 Darin Adler <darin@apple.com>
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Jan 2009 07:39:02 +0000 (07:39 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Jan 2009 07:39:02 +0000 (07:39 +0000)
        Reviewed by Alexey Proskuryakov.

        Bug 23448: memory leak in Mac version of preferredExtensionForImageSourceType
        https://bugs.webkit.org/show_bug.cgi?id=23448

        * platform/graphics/cg/ImageSourceCGMac.mm:
        (WebCore::preferredExtensionForImageSourceType): Use RetainPtr to avoid the leak.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@40084 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/graphics/cg/ImageSourceCGMac.mm

index 12dafd4..6646c37 100644 (file)
@@ -1,5 +1,15 @@
 2009-01-20  Darin Adler  <darin@apple.com>
 
+        Reviewed by Alexey Proskuryakov.
+
+        Bug 23448: memory leak in Mac version of preferredExtensionForImageSourceType
+        https://bugs.webkit.org/show_bug.cgi?id=23448
+
+        * platform/graphics/cg/ImageSourceCGMac.mm:
+        (WebCore::preferredExtensionForImageSourceType): Use RetainPtr to avoid the leak.
+
+2009-01-20  Darin Adler  <darin@apple.com>
+
         Try to fix Wx build.
 
         * platform/wx/PasteboardWx.cpp:
index 71ce5e3..297e30a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2008, 2009 Apple Inc. All Rights Reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -41,7 +41,8 @@ String MIMETypeForImageSourceType(const String& uti)
 String preferredExtensionForImageSourceType(const String& uti)
 {
     RetainPtr<CFStringRef> type(AdoptCF, uti.createCFString());
-    return UTTypeCopyPreferredTagWithClass(type.get(), kUTTagClassFilenameExtension);
+    RetainPtr<CFStringRef> extension(AdoptCF, UTTypeCopyPreferredTagWithClass(type.get(), kUTTagClassFilenameExtension));
+    return extension.get();
 }
 
 } // namespace WebCore