Skip to content

Commit

Permalink
Merge pull request #2482 from freakboy3742/memory-retention
Browse files Browse the repository at this point in the history
Remove some over-enthusiastic memory retention.
  • Loading branch information
mhsmith authored Apr 16, 2024
2 parents 3ccab57 + d9e6565 commit 4398e2a
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 4 deletions.
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

0 comments on commit 4398e2a

Please sign in to comment.