Partly revert "Android: use NewGlobalRef for references that are used globally"

The added complexity wasn't needed for most subsystems, as main() never returns
so local references can't be freed.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29570 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Maurus Cuelenaere 2011-03-11 19:23:00 +00:00
parent 66f2a08f8a
commit c2ee32b22a
6 changed files with 23 additions and 48 deletions

View file

@ -128,14 +128,13 @@ void notification_init(void)
JNIEnv e = *env_ptr;
jfieldID nNM = e->GetFieldID(env_ptr, RockboxService_class,
"fg_runner", "Lorg/rockbox/Helper/RunForegroundManager;");
jobject nMN_instance = e->GetObjectField(env_ptr,
RockboxService_instance, nNM);
if (nMN_instance == NULL)
NotificationManager_instance = e->GetObjectField(env_ptr,
RockboxService_instance, nNM);
if (NotificationManager_instance == NULL)
{
DEBUGF("Failed to get RunForegroundManager instance. Performance will be bad");
return;
}
NotificationManager_instance = e->NewGlobalRef(env_ptr, nMN_instance);
jclass class = e->GetObjectClass(env_ptr, NotificationManager_instance);
updateNotification = e->GetMethodID(env_ptr, class, "updateNotification",