Bug 865136 - Calling nsIProfile->Remove() twice removes all profiles, r=bsmedberg
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Fri, 26 Apr 2013 10:01:41 +0200
changeset 130148 6553478822f55b678f5071b345370c2093485581
parent 130147 824fccf23d6f56a741c4718e365777fbaa8f903e
child 130149 b68c721a1462b79c95696cd47e03dabd35e4a8fa
push id24599
push userryanvm@gmail.com
push dateSun, 28 Apr 2013 01:24:06 +0000
treeherdermozilla-central@9d8977cbbfc6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs865136
milestone23.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 865136 - Calling nsIProfile->Remove() twice removes all profiles, r=bsmedberg
toolkit/profile/nsToolkitProfileService.cpp
--- a/toolkit/profile/nsToolkitProfileService.cpp
+++ b/toolkit/profile/nsToolkitProfileService.cpp
@@ -227,16 +227,19 @@ nsToolkitProfile::Remove(bool removeFile
     NS_ASSERTION(nsToolkitProfileService::gService,
                  "Whoa, my service is gone.");
 
     NS_ENSURE_TRUE(!mForExternalApp, NS_ERROR_NOT_IMPLEMENTED);
 
     if (mLock)
         return NS_ERROR_FILE_IS_LOCKED;
 
+    if (!mPrev && !mNext && nsToolkitProfileService::gService->mFirst != this)
+        return NS_ERROR_NOT_INITIALIZED;
+
     if (removeFiles) {
         bool equals;
         nsresult rv = mRootDir->Equals(mLocalDir, &equals);
         if (NS_FAILED(rv))
             return rv;
 
         // The root dir might contain the temp dir, so remove
         // the temp dir first.