Bug 410731 - Crash [@ nssTrustDomain_LockCertCache] when quitting Camino with the 'Certificates' window open. Patch by Doug Turner <doug.turner@gmail.com>, r=smorgan, sr=pink, a/Cm1.6.4=me

git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@253813 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
alqahira%ardisson.org
2008-08-25 17:36:02 +00:00
parent 87d1da1261
commit 42fef2fc71
2 changed files with 14 additions and 24 deletions

View File

@@ -39,8 +39,6 @@
#import <AppKit/AppKit.h>
class CertDataOwner;
@class ExtendedSplitView;
@class ExtendedOutlineView;
@@ -58,8 +56,6 @@ class CertDataOwner;
NSArray* mCertificatesData;
NSString* mDetailsColumnKey;
CertDataOwner* mDataOwner; // container for C++ stuff
}
+ (CertificatesWindowController*)sharedCertificatesWindowController;

View File

@@ -61,20 +61,6 @@
#import "ViewCertificateDialogController.h"
#import "CertificatesWindowController.h"
// C++ class that holds owning refs to XPCOM interfaces for the window controller
class CertDataOwner
{
public:
CertDataOwner()
{
mCertCache = do_CreateInstance("@mozilla.org/security/nsscertcache;1");
mCertCache->CacheAllCerts();
}
nsCOMPtr<nsINSSCertCache> mCertCache;
};
#pragma mark -
@interface CertificatesWindowController(Private)
@@ -420,7 +406,6 @@ static CertificatesWindowController* gCertificatesWindowController;
[mCertificatesData release];
[mDetailsColumnKey release];
delete mDataOwner;
[super dealloc];
}
@@ -581,9 +566,6 @@ static CertificatesWindowController* gCertificatesWindowController;
if (curSelectedRow == -1)
curSelectedRow = 0;
delete mDataOwner;
mDataOwner = new CertDataOwner;
[self setupCertsData];
[mCategoriesTable reloadData];
@@ -697,8 +679,20 @@ static CertificatesWindowController* gCertificatesWindowController;
{
rowDict = [mCertificatesData objectAtIndex:rowIndex];
CertificatesDataSource* certsDataSource = [rowDict objectForKey:@"data_source"];
[certsDataSource ensureCertsLoaded:mDataOwner->mCertCache.get()];
[mCertsOutlineView setDataSource:certsDataSource];
nsCOMPtr<nsINSSCertCache> certCache = do_CreateInstance("@mozilla.org/security/nsscertcache;1");
// If we can't access the cert cache (for example during app shutdown),
// let's just clear the view, and move on.
if (certCache)
{
certCache->CacheAllCerts();
[certsDataSource ensureCertsLoaded:certCache];
[mCertsOutlineView setDataSource:certsDataSource];
}
else
{
[mCertsOutlineView setDataSource:nil];
}
}
else
{