Skip to content

Fix memory leaks and TODOs in C source#29

Merged
benoitc merged 3 commits intomainfrom
fix/memory-and-todos
Mar 14, 2026
Merged

Fix memory leaks and TODOs in C source#29
benoitc merged 3 commits intomainfrom
fix/memory-and-todos

Conversation

@benoitc
Copy link
Owner

@benoitc benoitc commented Mar 14, 2026

Summary

  • Fix PyDict_New memory leak when ns == NULL in py_subinterp_thread.c
  • Add stderr logging when event loop queue reaches max capacity
  • Use py_to_term() for result serialization instead of manual type conversion

benoitc added 3 commits March 14, 2026 16:21
Track ownership of globals/locals dicts allocated when ns == NULL.
Clean up before all early break statements and after the switch.
Replace TODO with fprintf to stderr when queue reaches max capacity.
Export py_to_term from py_convert.c and use it instead of manual
type conversion. Supports lists, dicts, tuples, and all other types.
@benoitc benoitc merged commit c022af6 into main Mar 14, 2026
11 checks passed
@benoitc benoitc deleted the fix/memory-and-todos branch March 14, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant