Title: [95576] trunk/Source/WebCore
Revision
95576
Author
[email protected]
Date
2011-09-20 15:39:38 -0700 (Tue, 20 Sep 2011)

Log Message

Use DEFINE_STATIC_LOCAL to intentionally leak the static RefCountedHFONT object returned from
FontPlatformData::hashTableDeletedFontValue() to avoid global destructor ordering problems.
https://bugs.webkit.org/show_bug.cgi?id=67906

Patch by Marshall Greenblatt <[email protected]> on 2011-09-20
Reviewed by Adam Barth.

* platform/graphics/chromium/FontPlatformDataChromiumWin.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (95575 => 95576)


--- trunk/Source/WebCore/ChangeLog	2011-09-20 22:37:58 UTC (rev 95575)
+++ trunk/Source/WebCore/ChangeLog	2011-09-20 22:39:38 UTC (rev 95576)
@@ -1,3 +1,13 @@
+2011-09-20  Marshall Greenblatt  <[email protected]>
+
+        Use DEFINE_STATIC_LOCAL to intentionally leak the static RefCountedHFONT object returned from
+        FontPlatformData::hashTableDeletedFontValue() to avoid global destructor ordering problems.
+        https://bugs.webkit.org/show_bug.cgi?id=67906
+
+        Reviewed by Adam Barth.
+
+        * platform/graphics/chromium/FontPlatformDataChromiumWin.cpp:
+
 2011-09-20  Ryosuke Niwa  <[email protected]>
 
         Hit testing on margins of body and head elements doesn't recur

Modified: trunk/Source/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.cpp (95575 => 95576)


--- trunk/Source/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.cpp	2011-09-20 22:37:58 UTC (rev 95575)
+++ trunk/Source/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.cpp	2011-09-20 22:39:38 UTC (rev 95576)
@@ -38,6 +38,7 @@
 
 #include "PlatformSupport.h"
 #include "SkiaFontWin.h"
+#include "StdLibExtras.h"
 
 namespace WebCore {
 
@@ -116,8 +117,8 @@
 
 FontPlatformData::RefCountedHFONT* FontPlatformData::hashTableDeletedFontValue()
 {
-    static RefPtr<RefCountedHFONT> deletedValue =
-        RefCountedHFONT::create(reinterpret_cast<HFONT>(-1));
+    DEFINE_STATIC_LOCAL(RefPtr<RefCountedHFONT>, deletedValue,
+                        (RefCountedHFONT::create(reinterpret_cast<HFONT>(-1))));
     return deletedValue.get();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to