On Fri, Feb 06, 2009 at 11:07:24AM -0800, Andi Vajda wrote: > > 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 ?
Yes. I commented out the lines #for name, entries in packages: # line(out, indent + 1, '%s::__initialize__(module);', name) from python.py, removed the build directory and rebuilt (checking that the 'java::__initialize__' and 'org::__initialize__' calls were gone from __init__.cpp), and reran, and it still faults. Aaron (a...@pobox.com)