On Fri, 6 Feb 2009, Aaron Lav wrote:

Does it crash if you don't call initVM() ?

No, the call to _testjcc.initVM(...) seems to be required to
make it crash.

There are two pieces to initVM():
  - initVM() proper (defined in jcc.cpp)
  - initializing your classes

The initVM() that is called from Python is a function called __initialize__() that is generated by JCC. It's defined in a file called __init__.cpp. It first calls the actual initVM() and then calls the
__initialize__() on each top level package JCC generates wrappers for.

For example, PyLucene's __initialize__() looks like:

PyObject *__initialize__(PyObject *module, PyObject *args, PyObject *kwds)
{
    PyObject *env = initVM(module, args, kwds);

    if (env == NULL)
        return NULL;

    java::__initialize__(module);
    org::__initialize__(module);

    return env;
}

Does it still crash if you comment out the calls to __initialize__(module) that the top level __initialize__() makes ?

Andi..

Reply via email to