[reportlab-users] Chasing pyHnj error
Dinu Gherman
gherman at darwin.in-berlin.de
Sun Nov 25 08:24:07 EST 2007
Robin Becker:
>> the error is almost certainly caused by the dealloc of the Hyphen
>> object. That routine looks like
>
> static void
> Hyphen_dealloc(Hyphenobject *self) {
> if (self->hdict != NULL) {
> hnj_hyphen_free(self->hdict);
> self->hdict = NULL;
> }
> PyMem_DEL(self);
> }
>
>
> Try the script
>
> import pyHnj
> print pyHnj.__file__
> h = pyHnj.Hyphen("hyphen.mashed")
> del h
>
> if that errors then it's almost certainly just the allocate/
> deallocate.
I also tried del previously and it did produce the same error.
> I notice that we're using PyObject_NEW as allocation and PyMem_DEL
> as deallocate. I'm almost sure that's wrong; I'm just not seeing
> the error.
> I checked in a change to use the PyObject_DEL in place of
> PyMem_DEL. Can you give that a try?
Just did that with great success! It now works fine on a MacBook Pro
and a PowerBook! Thanks a lot! Maybe you want to communicate your
fix to Danny Yoo so he can update his Python wrapper, too (which
should not be so different from yours)?
See http://hkn.eecs.berkeley.edu/~dyoo/python/pyHnj/index.html and
dyoo at hkn.eecs.berkeley.edu
Regards,
Dinu
More information about the reportlab-users
mailing list