Skip to content

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

Merged
lonvia merged 2 commits into
osmcode:masterfrom
lonvia:reference-counting
Nov 17, 2026
Merged

lonvia merged 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.

@lonvia
lonvia merged commit 6528bf3 into osmcode:master Nov 17, 2026
29 checks passed
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