Skip to content

Commit

Permalink
update change notes with migration instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
samschott committed Nov 24, 2024
1 parent b4a1624 commit f0edb5b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 9 additions & 1 deletion changes/256.bugfix.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
Retain Objective-C objects when creating Python wrappers and release them when the
Python wrapped is garbage collected.
Python wrapped is garbage collected. This means that manual ``retain`` calls and
subsequent ``release`` or ``autorelease`` calls from Python are no longer needed with
very few exceptions such as:

1. When implementing methods like ``copy`` that are supposed to create an object, if
the returned object is not actually newly created.
2. When dealing with side effects of methods like ``init`` that may release an object
which is still referenced from Python. See for example
https://github.com/beeware/toga/issues/2468.
4 changes: 4 additions & 0 deletions changes/256.removal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Rubicon no longer skips releasing an Objective-C objects when its Python wrapped is
garbage collected. This means that fewer ``retain`` than ``release`` calls will cause
segfaults on garbage collection. Review your code carefully for unbalanced ``retain``
and ``release`` calls before updating.

0 comments on commit f0edb5b

Please sign in to comment.