• 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: If any of the AXUIElement function fail, is memory for their result holders cleaned up?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: If any of the AXUIElement function fail, is memory for their result holders cleaned up?


  • Subject: Re: If any of the AXUIElement function fail, is memory for their result holders cleaned up?
  • From: aaron smith <email@hidden>
  • Date: Fri, 7 Aug 2009 20:46:51 -0700

dah. here's a pastebin of that code. it always gets messed up.

http://pastebin.com/m1faba5fa



On Fri, Aug 7, 2009 at 8:45 PM, aaron
smith<email@hidden> wrote:
> hey all, another quick question..
>
> I've been writing a wrapper around the accessibility api. Here's a
> quick snippet:
>
> - (AccessibilityOperationResult *) focusedApplicationRef {
>        if(![self isAccessibilityEnabled]) return [self getAPIDisabledOperationResult];
>        AccessibilityOperationResult *result =
> [[[AccessibilityOperationResult alloc] init] autorelease];
>        CFTypeRef res = NULL;
>        AXUIElementRef sys = AXUIElementCreateSystemWide();
>        int rescode = AXUIElementCopyAttributeValue(sys,(CFStringRef)kAXFocusedApplicationAttribute,(CFTypeRef
> *)&res);
>        CFRelease(sys);
>        [result setResultCode:rescode];
>        if([result wasSuccess]) {
>                [result setResult:res];
>                CFRelease(res);
>        }
>        return result;
> }
>
> I'm assuming that if a call to AXUIElementCopyAttributeValue fails, or
> any similar function, that I don't need to release the "res" variable
> - so I'm assuming that the accessibility api free's any memory that it
> had allocated if a failure happens.
>
> thanks much!
>
> -A
>
 _______________________________________________
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

References: 
 >If any of the AXUIElement function fail, is memory for their result holders cleaned up? (From: aaron smith <email@hidden>)

  • Prev by Date: If any of the AXUIElement function fail, is memory for their result holders cleaned up?
  • Next by Date: Re: If any of the AXUIElement function fail, is memory for their result holders cleaned up?
  • Previous by thread: If any of the AXUIElement function fail, is memory for their result holders cleaned up?
  • Next by thread: Re: If any of the AXUIElement function fail, is memory for their result holders cleaned up?
  • Index(es):
    • Date
    • Thread