]> git.ipfire.org Git - thirdparty/postgresql.git/commit
plpython: Clean up PyModule_AddObject() uses
authorPeter Eisentraut <peter@eisentraut.org>
Thu, 15 Jan 2026 09:24:49 +0000 (10:24 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Thu, 15 Jan 2026 09:32:38 +0000 (10:32 +0100)
commit34d8111c3abe97daea014f5587f405cde00d9e48
tree583c16a1715ae2dc7888a49f7fa653c9961001f5
parent8cb95a06455446ebc25c6e3b169881955afc3887
plpython: Clean up PyModule_AddObject() uses

The comments "PyModule_AddObject does not add a refcount to the
object, for some odd reason" seem distracting.  Arguably, this
behavior is expected, not odd.  Also, the additional references
created by the existing code are apparently not necessary.  But we
should clean up the reference in the error case, as suggested by the
Python documentation.

Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Matheus Alcantara <matheusssilv97@gmail.com>
Reviewed-by: li carol <carol.li2025@outlook.com>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Discussion: https://www.postgresql.org/message-id/f31333f1-fbb7-4098-b209-bf2d71fbd4f3%40eisentraut.org
src/pl/plpython/plpy_plpymodule.c