File tree 2 files changed +13
-1
lines changed
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
1
Retain Objective-C objects when creating Python wrappers and release them when the
2
- Python wrapped is garbage collected.
2
+ Python wrapped is garbage collected. This means that manual ``retain `` calls and
3
+ subsequent ``release `` or ``autorelease `` calls from Python are no longer needed with
4
+ very few exceptions such as:
5
+
6
+ 1. When implementing methods like ``copy `` that are supposed to create an object, if
7
+ the returned object is not actually newly created.
8
+ 2. When dealing with side effects of methods like ``init `` that may release an object
9
+ which is still referenced from Python. See for example
10
+ https://github.com/beeware/toga/issues/2468.
Original file line number Diff line number Diff line change
1
+ Rubicon no longer skips releasing an Objective-C objects when its Python wrapped is
2
+ garbage collected. This means that fewer ``retain `` than ``release `` calls will cause
3
+ segfaults on garbage collection. Review your code carefully for unbalanced ``retain ``
4
+ and ``release `` calls before updating.
You can’t perform that action at this time.
0 commit comments