• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problem With Removing Observers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem With Removing Observers


  • Subject: Re: Problem With Removing Observers
  • From: Michael Kamprath <email@hidden>
  • Date: Sat, 12 Oct 2002 13:53:05 -0700

on 10/12/02 1:27 PM, Eric Schlegel at email@hidden wrote:

>
> On Saturday, October 12, 2002, at 01:13 PM, Michael Kamprath wrote:
>
>> I can create and utilize Accessibility API observers just fine, but
>> when I
>> go to remove the observer with AXObserverRemoveNotification(), the
>> application that the observer was targeted at crashes. Is there
>> something
>> special I must do to remove an observer? I don't want to always be
>> watching
>> the events I am watching.
>
> I believe this is a known bug which we are planning to fix in a
> software update. Until then, I don't think there's any workaround.
>
> -eric
>

Actually, I just figured out a work around to get the functionality I want
with what I am assuming is a memory leak. Instead of removing the observer
with AXObserverRemoveNotification(), I instead remove it as a source from my
app's run loop with:

CFRunLoopRemoveSource(
CFRunLoopGetCurrent(),
AXObserverGetRunLoopSource(theObserver),
kCFRunLoopDefaultMode);

I no longer get notifications from that observer, and I can later install a
new observer on the same application with no problems.

Now, I am assuming this method is a pretty major memory leak, as the
observer is never destroyed (though I do call CFRelease on my reference to
it).

Do you think this is a safe approach?

Should I file a bug?

Michael F. Kamprath
email@hidden

Keyboard Maestro - Conduct Your Mac Like a Pro!
Download a free copy today at: www.KeyboardMaestro.com
_______________________________________________
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.

References: 
 >Re: Problem With Removing Observers (From: Eric Schlegel <email@hidden>)

  • Prev by Date: Re: Problem With Removing Observers
  • Next by Date: Full Keyboard Access
  • Previous by thread: Re: Problem With Removing Observers
  • Next by thread: Full Keyboard Access
  • Index(es):
    • Date
    • Thread