Bug 1291483 part 1: Use 'MakeUnique' instead of 'new' to allocate gfxFont::mGlyphChangeObservers. r=jfkthame
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 09 Mar 2017 16:38:56 -0800
changeset 347038 08753d5d8f1a05dedce9f91887a1e5426f35f8c0
parent 347037 0a7636f35a1d8db484956e6493ae597584bdf6ab
child 347039 2f96904d7b3ae012d17e25458f460f8de6cd5978
push id38719
push userdholbert@mozilla.com
push dateMon, 13 Mar 2017 02:43:44 +0000
treeherderautoland@2f96904d7b3a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs1291483
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1291483 part 1: Use 'MakeUnique' instead of 'new' to allocate gfxFont::mGlyphChangeObservers. r=jfkthame MozReview-Commit-ID: 7FO1HAukp5j
gfx/thebes/gfxFont.cpp
--- a/gfx/thebes/gfxFont.cpp
+++ b/gfx/thebes/gfxFont.cpp
@@ -3843,18 +3843,18 @@ gfxFont::AddSizeOfIncludingThis(MallocSi
     aSizes->mFontInstances += aMallocSizeOf(this);
     AddSizeOfExcludingThis(aMallocSizeOf, aSizes);
 }
 
 void
 gfxFont::AddGlyphChangeObserver(GlyphChangeObserver *aObserver)
 {
     if (!mGlyphChangeObservers) {
-        mGlyphChangeObservers.reset(
-            new nsTHashtable<nsPtrHashKey<GlyphChangeObserver>>);
+        mGlyphChangeObservers =
+            MakeUnique<nsTHashtable<nsPtrHashKey<GlyphChangeObserver>>>();
     }
     mGlyphChangeObservers->PutEntry(aObserver);
 }
 
 void
 gfxFont::RemoveGlyphChangeObserver(GlyphChangeObserver *aObserver)
 {
     NS_ASSERTION(mGlyphChangeObservers, "No observers registered");