To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=71078 Issue #|71078 Summary|pyuno: problems with allocated objects Component|udk Version|OOo 2.0.4 Platform|PC URL| OS/Version|Linux Status|NEW Status whiteboard| Keywords| Resolution| Issue type|PATCH Priority|P3 Subcomponent|code Assigned to|kr Reported by|pmladek
------- Additional comments from [EMAIL PROTECTED] Wed Nov 1 07:52:49 -0800 2006 ------- regcomp segfaulted when trying to register any python component on openSUSE-10.2. The problem was that pyuno deleted the objects using PyMem_DEL instead of PyObject_Del. The use of PyMem_DEL() is incorrect for object deallocation, because it only ever calls the low-level free(). If a custom allocator like pymalloc is used, it needs to be called to free the memory. I'll attach a patch that fixes it. I have also replaced PyObject_NEW with PyObject_New. They macro version is most probably deprecated and should not be used in the extensions modules. The following note can be found at http://docs.python.org/api/memoryInterface.html: --- cut --- In addition, the following macro sets are provided for calling the Python memory allocator directly, without involving the C API functions listed above. However, note that their use does not preserve binary compatibility across Python versions and is therefore deprecated in extension modules. PyMem_MALLOC(), PyMem_REALLOC(), PyMem_FREE(). PyMem_NEW(), PyMem_RESIZE(), PyMem_DEL(). --- cut --- Well, it talks about PyMem_ macros. I think that that the same applies also for the PyObject_ macros. They are even no longer mentioned at http://docs.python.org/api/allocating-objects.html I took inspiration for this second change at http://archives.postgresql.org/pgsql-interfaces/2002-03/msg00127.php --------------------------------------------------------------------- Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
