Chameleon Applications

Chameleon Applications Commit Details

Date:2012-11-05 01:02:34 (11 years 4 months ago)
Author:Rekursor
Commit:467
Parents: 466
Message:Fixed memory leaks and potential null ref
Changes:
M/trunk/ChameleonPrefPane/Sources/PreferencesControllerBase.mm

File differences

trunk/ChameleonPrefPane/Sources/PreferencesControllerBase.mm
189189
190190
191191
192
193
192
194193
195194
196195
......
200199
201200
202201
203
204
202
205203
206204
207205
......
217215
218216
219217
220
221
218
222219
223220
224221
225222
226223
227224
228
229
225
226
230227
231228
232229
{
int val = (s.length()>0 ? 1 : 0 );
[(NSButton*)optionID setIntValue: val ];
[(NSTextField*) bod->contentID setStringValue:
[[NSString alloc] initWithUTF8String: s.c_str()] ];
[(NSTextField*) bod->contentID setStringValue: [NSString stringWithUTF8String: s.c_str()] ];
[(NSTextField*) bod->contentID setEnabled: val ? true : false];
[(NSTextField*) bod->contentID setEditable: val ? true : false];
}
{
int val = (s.length()>0 ? 1 : 0 );
[(NSButton*)optionID setIntValue: val ];
[(NSTextField*) bod->contentID setStringValue:
[[NSString alloc] initWithUTF8String: s.c_str()] ];
[(NSTextField*) bod->contentID setStringValue: [NSString stringWithUTF8String: s.c_str()] ];
[(NSTextField*) bod->contentID setEnabled: val ? true: false];
[(NSTextField*) bod->contentID setEditable: val ? true : false];
}
if(bod->Type==OptionKernel)
{
[(NSTextField*) bod->contentID setStringValue:
[[NSString alloc] initWithUTF8String:
kernelFlags.rightMember(s).c_str()] ];
[NSString stringWithUTF8String: kernelFlags.rightMember(s).c_str()] ];
[(NSTextField*) bod->contentID setEnabled: true];
[(NSTextField*) bod->contentID setEditable: true];
}
}
else
{ // set the default for thiso option
[(NSButton*)optionID setIntValue: (bod->Default[0] ? 1 :0) ];
{ // set the default for this option
[(NSButton*)optionID setIntValue: (bod->Default && bod->Default[0] ? 1 : 0) ];
if(bod->Type==OptionKernel)
{
[(NSTextField*) bod->contentID setEnabled: false];

Archive Download the corresponding diff file

Revision: 467