b=509244; gfx crash on memory pressure notification; r=karlt
authorVladimir Vukicevic <vladimir@pobox.com>
Fri, 14 Aug 2009 16:51:30 -0400
changeset 31569 11bd05bebf858c587a990437f07c582aa8988b2d
parent 31568 23491f65cc3e064b0723e12d05bf0e4aa09360b8
child 31570 8f77197a8f99c3a3fdf988033966e0139b604bca
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs509244
milestone1.9.3a1pre
b=509244; gfx crash on memory pressure notification; r=karlt
gfx/src/thebes/nsThebesFontMetrics.cpp
--- a/gfx/src/thebes/nsThebesFontMetrics.cpp
+++ b/gfx/src/thebes/nsThebesFontMetrics.cpp
@@ -53,16 +53,18 @@ NS_IMPL_ISUPPORTS1(nsThebesFontMetrics, 
 nsThebesFontMetrics::nsThebesFontMetrics()
 {
     mFontStyle = nsnull;
     mFontGroup = nsnull;
 }
 
 nsThebesFontMetrics::~nsThebesFontMetrics()
 {
+    if (mDeviceContext)
+        mDeviceContext->FontMetricsDeleted(this);
     delete mFontStyle;
     //delete mFontGroup;
 }
 
 NS_IMETHODIMP
 nsThebesFontMetrics::Init(const nsFont& aFont, nsIAtom* aLangGroup,
                           nsIDeviceContext *aContext, 
                           gfxUserFontSet *aUserFontSet)
@@ -97,16 +99,17 @@ nsThebesFontMetrics::Init(const nsFont& 
         return NS_ERROR_UNEXPECTED;
 
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsThebesFontMetrics::Destroy()
 {
+    mDeviceContext = nsnull;
     return NS_OK;
 }
 
 // XXXTODO get rid of this macro
 #define ROUND_TO_TWIPS(x) (nscoord)floor(((x) * mP2A) + 0.5)
 #define CEIL_TO_TWIPS(x) (nscoord)NS_ceil((x) * mP2A)
 
 const gfxFont::Metrics& nsThebesFontMetrics::GetMetrics() const