Bug 155080; move SavePrefFile call ahead of call to ShutDownCurrentProfile; this does two things: (a) protects prefs.js with profile lock (b) prevents collision on prefs.js that causes prefs to be lost; r=ccarlen, sr=bryner, a=asa

git-svn-id: svn://10.0.0.236/trunk@126214 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
law%netscape.com 2002-08-02 04:11:45 +00:00
parent c3d7c55366
commit 0b6bd19827

View File

@ -854,6 +854,15 @@ static nsresult DoOnShutdown()
{
nsresult rv;
// save the prefs, in case they weren't saved
{
// scoping this in a block to force release
nsCOMPtr<nsIPref> prefs(do_GetService(NS_PREF_CONTRACTID, &rv));
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get prefs, so unable to save them");
if (NS_SUCCEEDED(rv))
prefs->SavePrefFile(nsnull);
}
// call ShutDownCurrentProfile() so we update the last modified time of the profile
{
// scoping this in a block to force release
@ -865,15 +874,6 @@ static nsresult DoOnShutdown()
}
}
// save the prefs, in case they weren't saved
{
// scoping this in a block to force release
nsCOMPtr<nsIPref> prefs(do_GetService(NS_PREF_CONTRACTID, &rv));
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get prefs, so unable to save them");
if (NS_SUCCEEDED(rv))
prefs->SavePrefFile(nsnull);
}
// at this point, all that is on the clipboard is a proxy object, but that object
// won't be valid once the app goes away. As a result, we need to force the data
// out of that proxy and properly onto the clipboard. This can't be done in the