Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some over-enthusiastic memory retention. #2482

Merged
merged 2 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion changes/2472.bugfix.rst
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Fix memory leaks for toga.Icon and toga.Image in the Cocoa backend.
Some memory leaks associated with macOS Icon and Image storage were resolved.
1 change: 1 addition & 0 deletions changes/2482.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Some memory leaks associated with the macOS Table, Tree and DetailedList widgets were resolved.
1 change: 0 additions & 1 deletion cocoa/src/toga_cocoa/widgets/detailedlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def tableView_objectValueForTableColumn_row_(self, table, column, row: int):
data = value._impl
except AttributeError:
data = TogaData.alloc().init()
data.retain()
value._impl = data

try:
Expand Down
1 change: 0 additions & 1 deletion cocoa/src/toga_cocoa/widgets/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def tableView_viewForTableColumn_row_(self, table, column, row: int):

# Prevent tcv from being deallocated prematurely when no Python references
# are left
tcv.retain()
tcv.autorelease()

tcv.setText(str(value))
Expand Down
1 change: 0 additions & 1 deletion cocoa/src/toga_cocoa/widgets/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ def outlineView_viewForTableColumn_item_(self, tree, column, item):

# Prevent tcv from being deallocated prematurely when no Python references
# are left
tcv.retain()
tcv.autorelease()

tcv.setText(str(value))
Expand Down
Loading