Skip to content

Improve reference counting for python handler and handler chain - #330

Open
lonvia wants to merge 2 commits into
osmcode:masterfrom
lonvia:reference-counting
Open

lonvia wants to merge 2 commits into
osmcode:masterfrom
lonvia:reference-counting

Conversation

@lonvia

@lonvia lonvia commented Nov 8, 2026

Copy link
Copy Markdown
Member

Both the HandlerChain and PythonHandler classes have left reference counting of Python objects they use to the owning objects. That makes using these classes difficult and error prone. It does save the occasional reference increase/decrease but not in places where it is really relevant for performance.

This changes the classes to hold the Python objects as proper py::objects, removes reference holding on containing objects where it was still done and adds some tests.

Also fixes holding container references for the area manager's second stage handler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant