diff --git a/changes/2472.bugfix.rst b/changes/2472.bugfix.rst index 8598a3505b..2540621f35 100644 --- a/changes/2472.bugfix.rst +++ b/changes/2472.bugfix.rst @@ -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. diff --git a/changes/2482.bugfix.rst b/changes/2482.bugfix.rst new file mode 100644 index 0000000000..ea6fdf87ff --- /dev/null +++ b/changes/2482.bugfix.rst @@ -0,0 +1 @@ +Some memory leaks associated with the macOS Table, Tree and DetailedList widgets were resolved. diff --git a/cocoa/src/toga_cocoa/widgets/detailedlist.py b/cocoa/src/toga_cocoa/widgets/detailedlist.py index 67bc415ea7..8e007deee0 100644 --- a/cocoa/src/toga_cocoa/widgets/detailedlist.py +++ b/cocoa/src/toga_cocoa/widgets/detailedlist.py @@ -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: diff --git a/cocoa/src/toga_cocoa/widgets/table.py b/cocoa/src/toga_cocoa/widgets/table.py index 0376833fc7..635cf6e55e 100644 --- a/cocoa/src/toga_cocoa/widgets/table.py +++ b/cocoa/src/toga_cocoa/widgets/table.py @@ -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)) diff --git a/cocoa/src/toga_cocoa/widgets/tree.py b/cocoa/src/toga_cocoa/widgets/tree.py index b5bc7d4c1f..889481904b 100644 --- a/cocoa/src/toga_cocoa/widgets/tree.py +++ b/cocoa/src/toga_cocoa/widgets/tree.py @@ -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))