'Is it necessary to call AXObserverRemoveNotification when its associated AXUIElementRef or AXObserverRef is released?
I'm using macOS's Accessibility API to track changes across a large number of UI elements within a single application, and am doing so with a single AXObserverRef.
As the application runs and changes its UI, I get kAXUIElementDestroyedNotification notifications via this observer informing that a UI element has been destroyed.
In this circumstance, is it necessary to call AXObserverRemoveNotification for the associated AXUIElementRef, or is that all handled automatically behind the scenes? Apple's documentation doesn't say one way or other.
Further, if I release the AXObserverRef, can I rely on all of the notifications added to it using AXObserverAddNotification being automatically cleaned up and removed? Or do I need to call AXObserverRemoveNotification for every notification I added in order to keep things clean and ensure everything is released? Again Apple's documentation doesn't say one way or the other.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
