From: Kent Sutherland Date: Mon, 2 Dec 2002 00:45:25 +0000 (+0000) Subject: Played around with some things. There is a massive mem leak in X-Git-Tag: v1.0~277 X-Git-Url: http://git.ithinksw.org/MenuTunes.git/commitdiff_plain/1e64b5d75911f02ab001d77a2036b9812cc9125a Played around with some things. There is a massive mem leak in runScriptAndReturnResult... --- diff --git a/English.lproj/Preferences.nib/classes.nib b/English.lproj/Preferences.nib/classes.nib index 10e4f8f..1a160da 100755 --- a/English.lproj/Preferences.nib/classes.nib +++ b/English.lproj/Preferences.nib/classes.nib @@ -22,6 +22,7 @@ albumCheckbox = NSButton; allTableView = NSTableView; artistCheckbox = NSButton; + hotKeyTextField = NSTextField; keyComboField = NSTextField; keyComboPanel = NSPanel; launchAtLoginCheckbox = NSButton; diff --git a/English.lproj/Preferences.nib/objects.nib b/English.lproj/Preferences.nib/objects.nib index d14359c..b5577cf 100755 Binary files a/English.lproj/Preferences.nib/objects.nib and b/English.lproj/Preferences.nib/objects.nib differ diff --git a/MenuTunes.m b/MenuTunes.m index 0227042..ad39b32 100755 --- a/MenuTunes.m +++ b/MenuTunes.m @@ -15,6 +15,9 @@ Things to do: - going to need a different way of defining key combos ¥ Optimize, this thing is big and slow :( ¥ Apple Events! Apple Events! Apple Events! + +¥ I think I found a slight memory leak: + 425 MenuTunes 7.8% 8:29.87 1 56 4827 215M+ 3.14M 135M- 599M+ */ #import "MenuTunes.h" @@ -400,6 +403,8 @@ target:self selector:@selector(timerUpdate) userInfo:nil repeats:YES]; buffer = malloc(length); AEGetDescData(&resultDesc, buffer, length); + AEDisposeDesc(&scriptDesc); + AEDisposeDesc(&resultDesc); result = [NSString stringWithCString:buffer length:length]; if (![result isEqualToString:@""] && ([result characterAtIndex:0] == '\"') && @@ -407,6 +412,7 @@ target:self selector:@selector(timerUpdate) userInfo:nil repeats:YES]; { result = [result substringWithRange:NSMakeRange(1, [result length] - 2)]; } + [script release]; free(buffer); buffer = NULL; return result; diff --git a/PreferencesController.h b/PreferencesController.h index e03a1c8..faf4ad1 100755 --- a/PreferencesController.h +++ b/PreferencesController.h @@ -9,6 +9,7 @@ IBOutlet NSButton *albumCheckbox; IBOutlet NSTableView *allTableView; IBOutlet NSButton *artistCheckbox; + IBOutlet NSTextField *hotKeyTextField; IBOutlet NSTextField *keyComboField; IBOutlet NSPanel *keyComboPanel; IBOutlet NSButton *launchAtLoginCheckbox; diff --git a/PreferencesController.m b/PreferencesController.m index 4a2d389..7384be5 100755 --- a/PreferencesController.m +++ b/PreferencesController.m @@ -465,6 +465,17 @@ [keyComboField setStringValue:string]; } +// +// +// Text Field Delegate +// +// + +- (void)controlTextDidChange:(NSNotification *)note +{ + NSLog(@"%@", [note userInfo]); +} + // // // Table View Datasource Methods