...
- ObjC objects that are +alloc'd or -retained are not actually pinned in GC-mode unless they have been CFRetain()'d
- As a counterpoint, any CFRetain()'d ObjC object must be -released or -autoreleased for it's retain count to remain balanced in RR mode
- The ObjC garbage collector cannot see into the Java heap, and infer if any native objects are still "alive"
Don't manage JNI global refs yourself
- If you need to pass a Java object through native (like to the main AppKit thread, or inside of an NSArray), use JNFJObjectWrapper or JNFJObjectWeakWrapper
- It handles all the details of managing a JNI global ref in a native ObjC object in both RR and GC modes
- If you have a JNIEnv when you are done with the JNFJObjectWrapper, pre-clear the reference
- It is more efficient than the wrapper's -dealloc, which may have to connect the current thread to the JVM (possibly a ObjC-GC collector thread), just for the purposes of deleting the ref.
Overview
Content Tools
ThemeBuilder