This commit is contained in:
edburns%acm.org 2004-10-10 02:02:52 +00:00
Родитель 1bf88ed4df
Коммит 3cfb7955b2
1 изменённых файлов: 7 добавлений и 7 удалений

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

@ -300,7 +300,13 @@ Java_org_mozilla_webclient_impl_wrapper_1native_PreferencesImpl_nativeRegisterPr
prefs = wcContext->sPrefs;
PR_ASSERT(prefs);
// step one, set up our struct
// step one: create a const char * from the prefName
if (nsnull == (prefNameChars = ::util_GetStringUTFChars(env, prefName))) {
::util_ThrowExceptionToJava(env, "Exception: nativeRegisterPrefChangedCallback: can't get string for prefName");
return;
}
// step two, set up our struct
peStruct *pes = new peStruct();
pes->cx = wcContext;
@ -308,12 +314,6 @@ Java_org_mozilla_webclient_impl_wrapper_1native_PreferencesImpl_nativeRegisterPr
pes->callback = ::util_NewGlobalRef(env, callback);
closures.Put(nsDependentCString(prefNameChars), pes);
// step two: create a const char * from the prefName
if (nsnull == (prefNameChars = ::util_GetStringUTFChars(env, prefName))) {
::util_ThrowExceptionToJava(env, "Exception: nativeRegisterPrefChangedCallback: can't get string for prefName");
return;
}
rv = prefs->RegisterCallback(prefNameChars, prefChanged, pes);
if (NS_FAILED(rv)) {