@Target(value=LOCAL_VARIABLE) @Retention(value=SOURCE) public @interface RetainedLocalRef
For example, a ThreadPoolExecutor is used to process a list of tasks, removing each task from the list as it is processed. ThreadPoolExecutor tasks are run inside of an AutoreleasePool, since these executors are often long-lived. If a local variable is initialized to one of the task list's elements, by default that variable won't be valid (will be deallocated) after task processing. Adding a LocalRetain annotation to the local variable ensures it is still valid after task processing.
Copyright © 2017. All rights reserved.