Re: AXObserverRemoveNotification sometimes painfully slow [Follow up to] Hidden Cocoa apps have empty kAXWindowsAttribute
Re: AXObserverRemoveNotification sometimes painfully slow [Follow up to] Hidden Cocoa apps have empty kAXWindowsAttribute
- Subject: Re: AXObserverRemoveNotification sometimes painfully slow [Follow up to] Hidden Cocoa apps have empty kAXWindowsAttribute
- From: John Louch <email@hidden>
- Date: Wed, 26 Mar 2003 10:29:42 -0800
>
>> I was thinking though, as long as I eventually CFRelease the observer
>
>> itself, do I still need to AXObserverRemoveNotification on each
>
>> notification
>
>> it is interested in. i.e. will it still leak if I don't. Currently I
>
>> have
>
>> one observer per application I am observing and when that app quits,
>
>> the
>
>> observer is released. Surely this should clean everything up, and if it
>
>> doesn't wouldn't that be considered a bug?
>
>
>
> This should be fine.
>
>
>
Let me just clarify what my app is doing so that I can be sure that it is
>
indeed fine.
>
>
My app creates one observer per other application (lets call the observer
>
Bernard). Bernard is set up to be notified of kAXWindowCreatedNotification.
>
>
Once my app notices that another app has got a window that I am interested
>
in keeping track of, I install kAXUIElementDestroyedNotification for that
>
window's AXUIElement on Bernard .
>
>
Once the app quits (or I lose interest in it as a whole) I call CFRelease on
>
Bernard.
>
>
Given this scenario, is it correct that there should be no memory leaks once
>
Bernard is released?
That is correct.
>
>
Assuming it is correct, roughly how much memory will be being wasted per
>
window that has been destroyed before Bernard is released (i.e. the user
>
never quits an app, but opens and closes (or hides) windows a lot)
There will be memory waisted in both your application and the the one you
are targeting. I am not sure what the total amount is. The you really
should not keep these things around as it will slow down processing of your
other notifications as well.
Thanks,
jl
>
>
>
Matt
>
---------------------------------------------
John Louch Internet #: email@hidden
(805) 546 0216
_______________________________________________
accessibility-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/accessibility-dev
Do not post admin requests to the list. They will be ignored.