I checked the code, to make sure it was the latest version, and it is ...
I cannot see any reason at all. env and name are passed in to the function
and the class is definitely resolved. Exception is checked for, so c must
be found (ClassNotFoundException is thrown otherwise). The only
possibilities I can see:
(a) env or name is corrupted. That can only have happened in the caller,
and is unlikely.
(b) c is NULL. FindClass would have to be in error for this to happen (I
think).
(c) c is corrupted. FindClass would *really* have to be in error for this
to happen.
(d) ExceptionOccurred does not catch the exception. Bloody unlikely.
(e) NewGlobalRef does not do its job right. Probably the most likely of
all.
c = (*env)->FindClass(env, name);
if((*env)->ExceptionOccurred(env)) {
return NULL;
}
c = (*env)->NewGlobalRef(env, c);
I don't know what a bus error is, specifically ... what exactly has to occur
for a bus error to happen?
--John Keiser
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Aaron
> M. Renn
> Sent: Thursday, July 16, 1998 7:23 PM
> To: [EMAIL PROTECTED]
> Subject: LINK_LinkClass Bus Error
>
>
> John, I am using your LINK_LinkClass function to cache jclass
> objects and am
> having problems. The call to NewGlobalRef(env, jclass) is core
> dumping with
> a bus error. Do you know of any reason why?
>
> --
> *****************************************************
> * Aaron M. Renn *
> * Email: [EMAIL PROTECTED] *
> * Homepage: <URL:http://www.urbanophile.com/arenn/> *
> *****************************************************
>
>