macdriver icon indicating copy to clipboard operation
macdriver copied to clipboard

retain or not

Open izturn opened this issue 3 years ago • 1 comments

Hi thanks for the awesome package. I have some questions about the example: pomodoro. the source snippets

obj := cocoa.NSStatusBar_System().StatusItemWithLength(cocoa.NSVariableStatusItemLength)
obj.Retain()

and

itemNext := cocoa.NSMenuItem_New()

they all about create instance, why the first one need retain, but the second one is NOT, if the first ONE is about MRC and the second is about ARC, why there is no release for the first one, thanks

izturn avatar May 10 '21 07:05 izturn

still trying to figure out the subtleties of making the two memory managers work together. only reason Retain was added in that demo was because otherwise it would get cleaned up too early on the objc side somehow.

progrium avatar May 27 '21 21:05 progrium