Fix crash when calling initEmbedding with an appFileLocProvider. Don't delete the locProvider proxy after having called NS_InitEmbedding. Not part of default build. a=mkaply

Original committer: pedemont%us.ibm.com
Original revision: 1.26
Original date: 2005/07/13 22:15:09
This commit is contained in:
pedemont%us.ibm.com 2006-09-27 15:17:57 +00:00
Родитель c80965cead
Коммит 4448a4947d
1 изменённых файлов: 4 добавлений и 7 удалений

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

@ -69,18 +69,15 @@ InitEmbedding_Impl(JNIEnv* env, jobject aMozBinDirectory,
}
// create nsAppFileLocProviderProxy from given Java object
nsAppFileLocProviderProxy* provider = nsnull;
nsCOMPtr<nsIDirectoryServiceProvider> provider;
if (aAppFileLocProvider) {
provider = new nsAppFileLocProviderProxy(aAppFileLocProvider);
if (!provider)
return NS_ERROR_OUT_OF_MEMORY;
rv = NS_NewAppFileLocProviderProxy(aAppFileLocProvider,
getter_AddRefs(provider));
NS_ENSURE_SUCCESS(rv, rv);
}
// init Gecko
rv = NS_InitEmbedding(directory, provider);
if (provider) {
delete provider;
}
NS_ENSURE_SUCCESS(rv, rv);
// init Event Queue