TextRunExpiringCache-finalized
author Benjamin Smedberg <benjamin@smedbergs.us>
Sat, 26 Jul 2008 22:49:39 -0400
changeset 167 a4da40849f5436e629c5732f4368c6c48189637f
parent 160 fd41ae75c7983b0c8aeff594c5c4cb25cde2ce5e
permissions -rw-r--r--
State as of now

diff --git a/gfx/thebes/src/gfxTextRunCache.cpp b/gfx/thebes/src/gfxTextRunCache.cpp
--- a/gfx/thebes/src/gfxTextRunCache.cpp
+++ b/gfx/thebes/src/gfxTextRunCache.cpp
@@ -43,7 +43,10 @@
 /*
  * Cache textruns and expire them after 3*10 seconds of no use
  */
-class TextRunExpiringCache : public nsExpirationTracker<gfxTextRun,3> {
+class TextRunExpiringCache
+    : public MMgc::GCFinalizable
+    , public nsExpirationTracker<gfxTextRun,3>
+{
 public:
     TextRunExpiringCache()
         : nsExpirationTracker<gfxTextRun,3>(10*1000) {}
@@ -56,6 +59,10 @@ public:
         RemoveObject(aTextRun);
         gfxTextRunWordCache::RemoveTextRun(aTextRun);
         delete aTextRun;
+    }
+
+    static void* operator new(size_t size) NS_GCFINALIZEDALLOCATOR {
+        return XPCOMGCFinalizedObject::operator new(size);
     }
 };