Bug 997963, part 3 - Make bundleCacheEntry_t::mHashKey into an nsAutoPtr. r=ehsan
authorAndrew McCreight <continuation@gmail.com>
Mon, 21 Apr 2014 09:41:57 -0700
changeset 197902 29173518f045ec4da474a50c6c2b6e7f08d87638
parent 197901 d5f5047b958510c1002fd34c1c9d227429ff29c0
child 197903 b7694e60758e8feaf4700285307b449722f4f441
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs997963
milestone31.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 997963, part 3 - Make bundleCacheEntry_t::mHashKey into an nsAutoPtr. r=ehsan
intl/strres/src/nsStringBundle.cpp
--- a/intl/strres/src/nsStringBundle.cpp
+++ b/intl/strres/src/nsStringBundle.cpp
@@ -483,17 +483,17 @@ nsresult nsExtensibleStringBundle::GetSi
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 /////////////////////////////////////////////////////////////////////////////////////////
 
 #define MAX_CACHED_BUNDLES 16
 
 struct bundleCacheEntry_t : public LinkedListElement<bundleCacheEntry_t> {
-  nsCStringKey *mHashKey;
+  nsAutoPtr<nsCStringKey> mHashKey;
   // do not use a nsCOMPtr - this is a struct not a class!
   nsIStringBundle* mBundle;
 };
 
 
 nsStringBundleService::nsStringBundleService() :
   mBundleMap(MAX_CACHED_BUNDLES, true)
 {
@@ -653,17 +653,16 @@ nsStringBundleService::insertIntoCache(n
   mBundleMap.Put(cacheEntry->mHashKey, cacheEntry);
 
   return cacheEntry;
 }
 
 void
 nsStringBundleService::recycleEntry(bundleCacheEntry_t *aEntry)
 {
-  delete aEntry->mHashKey;
   NS_RELEASE(aEntry->mBundle);
 }
 
 NS_IMETHODIMP
 nsStringBundleService::CreateBundle(const char* aURLSpec,
                                     nsIStringBundle** aResult)
 {
 #ifdef DEBUG_tao_