Bug 155192 crash [@nsRDFResource::~nsRDFResource] if gRDFService wasn't created

patch by tingley@sundell.net r=timeless sr=bz
This commit is contained in:
timeless%mozdev.org 2002-11-18 04:44:30 +00:00
Родитель 642e1817f6
Коммит 177bb07bf4
1 изменённых файлов: 9 добавлений и 7 удалений

Просмотреть файл

@ -68,15 +68,17 @@ nsRDFResource::~nsRDFResource(void)
delete doomed;
}
gRDFService->UnregisterResource(this);
if (mURI) {
gRDFService->UnregisterResource(this);
// N.B. that we need to free the URI *after* we un-cache the resource,
// due to the way that the resource manager is implemented.
nsCRT::free(mURI);
// N.B. that we need to free the URI *after* we un-cache the resource,
// due to the way that the resource manager is implemented.
nsCRT::free(mURI);
if (--gRDFServiceRefCnt == 0) {
nsServiceManager::ReleaseService(kRDFServiceCID, gRDFService);
gRDFService = nsnull;
if (--gRDFServiceRefCnt == 0) {
nsServiceManager::ReleaseService(kRDFServiceCID, gRDFService);
gRDFService = nsnull;
}
}
}