NSAppleScript leaking memory?
NSAppleScript leaking memory?
- Subject: NSAppleScript leaking memory?
- From: Andreas Mayer <email@hidden>
- Date: Thu, 25 Mar 2004 21:11:29 +0100
Hi.
My app is leaking memory and I think I have isolated it to the
(repeated) use of an AppleScript.
This is what I am doing:
1. loading the script (once)
NSAppleScript *queryScript;
NSURL *url = nil;
url = [NSURL fileURLWithPath:[[myBundle resourcePath]
stringByAppendingPathComponent:@"myScript.scpt"]];
[self setQueryScript:[[[NSAppleScript alloc] initWithContentsOfURL:url
error:nil] autorelease]];
2. executing the script (every some seconds)
NSDictionary *appleScriptError;
NSString * result;
NSAppleEventDescriptor *scriptResult = [queryScript
executeAndReturnError:&appleScriptError];
result = [[[scriptResult stringValue] copy] autorelease];
When I remove the second part (replacing it by assigning a constant
string to result) the leak is gone.
So can anyone spot an error in my code - or maybe confirm the leak?
BTW: Here is one 'set' of leaks:
Leak: 0x001da2e0 size=128
0xa167add8 0x001da2e0 0x00000005 0x00000001
0x61657674 0x9e9a898b 0x00000000 0x00000001
0x001b56a0 0x00000000 0x61657674 0x616e7372
0x28030053 0x00000000 0x00000000 0x00000070
0x00000000 0x00000000 0x00000000 0x03460001
0x00000000 0x00000000 0x00000000 0x70706320
0x001d99f0 0x00000000 0x00000000 0x00000000
0x00000000 0x00048579 0x00002160 0xbab6b160
Leak: 0x001d99f0 size=80
0xa167ac30 0x001d9a18 0x00000002 0x00000001
0x70736e20 0x8f8c91df 0x001d9a18 0x00000008
0x00000000 0x00000000 0x00000000 0x03460001
0x00000000 0x00000000 0x00000000 0x00000000
0x0016980b 0x00000000 0x0016ad70 0x00000000
Leak: 0x00119e50 size=80
0xa167ac30 0x00119e78 0x00000002 0x00000001
0x6c6f6e67 0x93909198 0x00119e78 0x00000004
0x00000000 0x00000000 0xfffff8f9 0x03460001
0xa167ab88 0x00000000 0x00000000 0x00000000
0x0015eb6b 0x00000000 0x0015de10 0x00000005
Leak: 0x001b56a0 size=16 string 'errn'
Andreas
_______________________________________________
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.