macdriver icon indicating copy to clipboard operation
macdriver copied to clipboard

add wrapper for managing Release with GC

Open mgood opened this issue 3 years ago • 1 comments

Helper for #49 to wrap an Object that will be released when it is freed by the Go garbage collector.

mgood avatar May 26 '21 05:05 mgood

If the type was exported as maybe GarbageCollected, you could then type assert to find out if an object has this finalizer set: gcobj, ok := obj.(GarbageCollected)

progrium avatar May 27 '21 20:05 progrium

Does anybody know how ARC works when using libobjc? Retain/release are considered obsolete, but in theory they can still be used for manual ref counting. Nobody has actually figured out what's going on here yet or what should be done, so all macdriver programs could be leaking objects.

progrium avatar Jul 09 '23 00:07 progrium

Got an objc.Retain function to do this now as documented in https://github.com/progrium/macdriver/blob/main/docs/memorymanagement.md

progrium avatar Aug 17 '23 09:08 progrium