Re: Releasing reference from AXObserverCreate
Re: Releasing reference from AXObserverCreate
- Subject: Re: Releasing reference from AXObserverCreate
- From: John Louch <email@hidden>
- Date: Mon, 21 Jun 2010 15:18:13 -0700
On Jun 21, 2010, at 3:12 PM, Ryan Joseph wrote:
> Is it necessary to release the reference from AXObserverCreate? I attempted this after adding notifications but it seemed to remove all of them.
Yes. Though as you found out releasing the last reference unregisters the notifications.
>
> If we do need to release should we always register a kAXUIElementDestroyedNotification then release inside the callback when it's called? It seems if this was the proper method there would be a notification or something we were sent when it was safe.
It is not a safety issue per say. Release the observer whenever you are no longer interested in notifications. That could be on receipt of a particular notification, or potentially just a lack of interest in the application you are monitoring.
Thanks,
jl
>
> Thanks.
>
> Regards,
> Josef
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Accessibility-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden