Re: Compiling AppleScript in Cocoa?
Re: Compiling AppleScript in Cocoa?
- Subject: Re: Compiling AppleScript in Cocoa?
- From: Cameron Hayne <email@hidden>
- Date: Thu, 16 Oct 2003 00:19:25 -0400
On 15/10/03 6:18 PM, "Keo Darksbane" <email@hidden> wrote:
>
NSDictionary *errs = [[NSDictionary alloc] init];
>
NSAppleScript *launcher = [[NSAppleScript alloc]
>
initWithSource: @"current date"];
>
[launcher compileAndReturnError:&errs];
This isn't an answer to your question about an error message from
'compileAndReturnError' but instead is a heads-up about what seems to be a
memory leak in the above code.
It seems to me that you shouldn't be alloc & init-ing that NSDictionary. I
think the compileAndReturnError will initialize the pointer whose address
you pass it (&errs) to point to an auto-released NSDictionary object. Hence
the NSDictionary object that you have alloc'd has been lost track of and so
you have a memory leak.
--
Cameron Hayne (email@hidden)
Hayne of Tintagel
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.