Skip to content

Commit

Permalink
add comment to copyWithZone_ about the retain call
Browse files Browse the repository at this point in the history
  • Loading branch information
samschott committed Nov 24, 2024
1 parent 0cc032d commit 147a1a2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cocoa/src/toga_cocoa/widgets/internal/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ class TogaData(NSObject):
@objc_method
def copyWithZone_(self):
# TogaData is used as an immutable reference to a row
# so the same object can be returned as a copy.
# so the same object can be returned as a copy. We need
# to manually `retain` the object before returning because
# the "copy" methods are assumed to return an object that
# is owned by the caller.
self.retain()
return self

0 comments on commit 147a1a2

Please sign in to comment.