зеркало из https://github.com/mozilla/gecko-dev.git
bug 108539, r=jag, sr=sfraser, need to call NS_IF_RELEASE(mInner) to prevent leak of datasource, also cleaned up create instance call
This commit is contained in:
Родитель
09750f9a69
Коммит
8a4edf9b41
|
@ -4138,10 +4138,11 @@ nsBookmarksService::initDatasource()
|
|||
|
||||
// the profile manager might call Readbookmarks() in certain circumstances
|
||||
// so we need to forget about any previous bookmarks
|
||||
mInner = nsnull;
|
||||
if (NS_FAILED(rv = nsComponentManager::CreateInstance(kRDFInMemoryDataSourceCID,
|
||||
nsnull, NS_GET_IID(nsIRDFDataSource), (void**) &mInner)))
|
||||
return(rv);
|
||||
NS_IF_RELEASE(mInner);
|
||||
|
||||
rv = CallCreateInstance(kRDFInMemoryDataSourceCID, &mInner);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
rv = mInner->AddObserver(this);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
|
Загрузка…
Ссылка в новой задаче