Skip to content

Commit 147a1a2

Browse files
committed
add comment to copyWithZone_ about the retain call
1 parent 0cc032d commit 147a1a2

File tree

1 file changed

+4
-1
lines changed
  • cocoa/src/toga_cocoa/widgets/internal

1 file changed

+4
-1
lines changed

cocoa/src/toga_cocoa/widgets/internal/data.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ class TogaData(NSObject):
55
@objc_method
66
def copyWithZone_(self):
77
# TogaData is used as an immutable reference to a row
8-
# so the same object can be returned as a copy.
8+
# so the same object can be returned as a copy. We need
9+
# to manually `retain` the object before returning because
10+
# the "copy" methods are assumed to return an object that
11+
# is owned by the caller.
912
self.retain()
1013
return self

0 commit comments

Comments
 (0)