Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: OSALoad and leaking handle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OSALoad and leaking handle



Micah,

I stepped over my call to OSALoad and discovered three similar blocks
allocated in my application heap. Interestingly, only one pointed to my
running application. The other two pointed to the "real" application living
in the extensions folder (my app is an FBA, so I debugged the copy in my
Output folder rather than the copy installed in the extensions folder).

However, my blocks ended around position 0x100, just after the full path
string. I suspect they are alias handles pointing back to the application,
perhaps for continuation handlers. In an case, my cleanup code did release
all three of the handles, as well as the other ten or so handles allocated
by OSALoad.

I wonder if OS or AppleScript versions could account for your handle being
leaked. I am running 9.0.4 with AS 1.4.3. I don't have any other test
system available right now, but perhaps AS 1.4.3 fixed the leak you are
seeing.

- Bill


Bill
>Nope, that didn't correct the problem. Thanks anyways. Checking the
>contents of the leaked handle I see some interesting stuff. The handle
>that is leaked is always the same size and always has the same contents,
>regardless of the script loaded. I see things like my app's name, type
>and creator code, its path, etc. in it. This offer any clues? My
>knownledge on this low level of stuff is pretty limited...but I'm
>learning. :) Thanks,
>Micah
>
>Here's the dump of the contents(best viewed using a monotype font).
>
> Offset Hex Contents ASCII Contents
>
>-----------------------------------------------------------------------
>0x00000000 | 0000 0000 01A6 0002 0000 0B4D 7920 436F | .....6.....My Co
>0x00000010 | 6D70 7574 6572 0000 0000 0000 0000 0000 | mputer..........
>0x00000020 | 0000 0000 0000 B64E AA75 4244 0000 0000 | .......NuBD....
>
>0x00000030 | 1D8E 0A54 5753 6372 6970 7465 7200 0000 | ..i.TWScripter...
>
>0x00000040 | 0000 0000 0000 0000 0000 0000 0000 0000 | .................
>
>0x00000050 | 0000 0000 0000 0000 0000 0000 0000 0000 | .................
>
>0x00000060 | 0000 0000 0000 0000 0000 0000 0000 0000 | .................
>
>0x00000070 | 0000 0000 1DA3 B5A8 5426 4150 504C 4D4B | ......#5.T&APPLMK
>
>0x00000080 | 4B4F FFFF FFFF 0000 0011 0000 0000 0000 | KO..............
>0x00000090 | 0000 0000 0000 0000 0006 4F75 7470 7574 | ...........Output
>
>0x000000A0 | 0001 0010 0000 1D8E 0000 1D8D 0000 1B84 | ........i...g...Q
>
>0x000000B0 | 0000 0016 0002 003D 4D79 2043 6F6D 7075 | .......=My Compu
>0x000000C0 | 7465 723A 5072 6F67 7261 6D6D 696E 673A | ter:Programming:
>0x000000D0 | 5072 6F6A 6563 7473 3A54 5753 6372 6970 | Projects:TWScrip
>0x000000E0 | 7465 723A 4F75 7470 7574 3A54 5753 6372 | ter:Output:TWScr
>0x000000F0 | 6970 7465 7200 0009 00A8 00A8 6166 706D | ipter.......afpm
>0x00000100 | 0000 0000 0003 0018 0039 0059 0075 0095 | ..........9.Y.u.o
>
>0x00000110 | 009E 012A 0000 0000 0000 0000 0000 0000 | ..{.*............
>
>0x00000120 | 0000 0000 0000 0000 0000 0000 0000 0000 | .................
>
>0x00000130 | 0000 0010 4D69 6361 6827 7320 436F 6D70 | ....Micah's Comp
>0x00000140 | 7574 6572 0000 0000 0000 0000 0000 0000 | uter............
>0x00000150 | 0000 000B 4D79 2043 6F6D 7075 7465 7200 | ....My Computer.
>0x00000160 | 0000 0000 0000 0000 0000 0000 0000 000A | .................
>
>0x00000170 | 4D69 6361 6820 4B6F 6368 0000 0000 0000 | Micah Koch......
>0x00000180 | 0000 0000 0000 0000 0000 0000 0000 0000 | .................
>
>0x00000190 | 0000 0000 0000 0000 0000 0000 0000 0000 | .................
>
>0x000001A0 | 0000 FFFF 0000 0000 0000 0000 0000 0000 | .................
>_______________________________________________
>applescript-implementors mailing list
>email@hidden
>http://www.lists.apple.com/mailman/listinfo/applescript-implementors


References: 
 >Re: OSALoad and leaking handle (From: Bill Peters <email@hidden>)
 >Re: OSALoad and leaking handle (From: Micah Koch <email@hidden>)
 >Re: OSALoad and leaking handle (From: Andy Bachorski <email@hidden>)
 >Re: OSALoad and leaking handle (From: Micah Koch <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.