Commit 275126b2 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman Committed by Jean-Baptiste Kempf

memleaks: Several Mac OS X interface related memleaks.

(cherry picked from commit bc3883a52ee35d2d118f8a7c43093faa253cc0b4)
parent 5f567ca5
......@@ -840,7 +840,7 @@
text_list.p_list->p_values[i].psz_string : val_list.p_list->p_values[i].psz_string ];
o_lmi = [o_menu addItemWithTitle: o_title action: pf_callback keyEquivalent: @""];
o_data = [[VLCAutoGeneratedMenuContent alloc] initWithVariableName: strdup(psz_variable) ofObject: p_object
o_data = [[VLCAutoGeneratedMenuContent alloc] initWithVariableName: psz_variable ofObject: p_object
andValue: another_val ofType: i_type];
[o_lmi setRepresentedObject: [o_data autorelease]];
[o_lmi setTarget: self];
......@@ -858,7 +858,7 @@
val_list.p_list->p_values[i].i_int];
o_lmi = [o_menu addItemWithTitle: o_title action: pf_callback keyEquivalent: @""];
o_data = [[VLCAutoGeneratedMenuContent alloc] initWithVariableName: strdup(psz_variable) ofObject: p_object
o_data = [[VLCAutoGeneratedMenuContent alloc] initWithVariableName: psz_variable ofObject: p_object
andValue: val_list.p_list->p_values[i] ofType: i_type];
[o_lmi setRepresentedObject: [o_data autorelease]];
[o_lmi setTarget: self];
......
......@@ -601,6 +601,7 @@
[o_mi_revealInFinder setEnabled: YES];
[o_mm_mi_revealInFinder setEnabled: YES];
}
free( psz_uri );
}
if( [[VLCMain sharedInstance] isPlaylistCollapsed] == NO )
......
......@@ -389,6 +389,13 @@ create_toolbar_item( NSString * o_itemIdent, NSString * o_name, NSString * o_des
[object setToolTip: _NS(p_item->psz_longtext)];
}
- (void)setupField:(NSTextField *)o_object forOption:(const char *)psz_option
{
char *psz_tmp = config_GetPsz( p_intf, psz_option );
[o_object setStringValue: [NSString stringWithUTF8String: psz_tmp ?: ""]];
free( psz_tmp );
}
- (void)resetControls
{
module_config_t *p_item;
......@@ -417,8 +424,7 @@ create_toolbar_item( NSString * o_itemIdent, NSString * o_name, NSString * o_des
[o_audio_spdif_ckb setState: config_GetInt( p_intf, "spdif" )];
[self setupButton: o_audio_dolby_pop forIntList: "force-dolby-surround"];
[o_audio_lang_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "audio-language" ) ?: ""]];
[self setupField: o_audio_lang_fld forOption: "audio-language"];
[o_audio_headphone_ckb setState: config_GetInt( p_intf, "headphone-dolby" )];
......@@ -428,6 +434,7 @@ create_toolbar_item( NSString * o_itemIdent, NSString * o_name, NSString * o_des
[o_audio_norm_ckb setState: (NSInteger)strstr( psz_tmp, "volnorm" )];
[o_audio_norm_fld setEnabled: [o_audio_norm_ckb state]];
[o_audio_norm_stepper setEnabled: [o_audio_norm_ckb state]];
free( psz_tmp );
}
[o_audio_norm_fld setFloatValue: config_GetFloat( p_intf, "norm-max-level" )];
......@@ -436,8 +443,8 @@ create_toolbar_item( NSString * o_itemIdent, NSString * o_name, NSString * o_des
/* Last.FM is optional */
if( module_exists( "audioscrobbler" ) )
{
[o_audio_lastuser_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "lastfm-username" ) ?: ""]];
[o_audio_lastpwd_sfld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "lastfm-password" ) ?: ""]];
[self setupField: o_audio_lastuser_fld forOption:"lastfm-username"];
[self setupField: o_audio_lastpwd_sfld forOption:"lastfm-password"];
if( config_ExistIntf( VLC_OBJECT( p_intf ), "audioscrobbler" ) )
{
......@@ -483,8 +490,8 @@ create_toolbar_item( NSString * o_itemIdent, NSString * o_name, NSString * o_des
[o_video_device_pop selectItemAtIndex: 0];
[o_video_device_pop selectItemWithTag: config_GetInt( p_intf, "macosx-vdev" )];
[o_video_snap_folder_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "snapshot-path" ) ?: ""]];
[o_video_snap_prefix_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "snapshot-prefix" ) ?: ""]];
[self setupField:o_video_snap_folder_fld forOption:"snapshot-path"];
[self setupField:o_video_snap_prefix_fld forOption:"snapshot-prefix"];
[o_video_snap_seqnum_ckb setState: config_GetInt( p_intf, "snapshot-sequential" )];
[self setupButton: o_video_snap_format_pop forStringList: "snapshot-format"];
......@@ -492,10 +499,8 @@ create_toolbar_item( NSString * o_itemIdent, NSString * o_name, NSString * o_des
* input & codecs settings *
***************************/
[o_input_serverport_fld setIntValue: config_GetInt( p_intf, "server-port" )];
if( config_GetPsz( p_intf, "http-proxy" ) != NULL )
[o_input_httpproxy_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "http-proxy" ) ?: ""]];
if( config_GetPsz( p_intf, "http-proxy" ) != NULL )
[o_input_httpproxypwd_sfld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "http-proxy-pwd" ) ?: ""]];
[self setupField:o_input_httpproxy_fld forOption:"http-proxy"];
[self setupField:o_input_httpproxypwd_sfld forOption:"http-proxy-pwd"];
[o_input_postproc_fld setIntValue: config_GetInt( p_intf, "postproc-q" )];
[self setupButton: o_input_avi_pop forIntList: "avi-index"];
......@@ -559,10 +564,8 @@ create_toolbar_item( NSString * o_itemIdent, NSString * o_name, NSString * o_des
[o_osd_osd_ckb setState: config_GetInt( p_intf, "osd" )];
[self setupButton: o_osd_encoding_pop forStringList: "subsdec-encoding"];
[o_osd_lang_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "sub-language" ) ?: ""]];
if( config_GetPsz( p_intf, "quartztext-font" ) != NULL )
[o_osd_font_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "quartztext-font" ) ?: ""]];
[self setupField: o_osd_lang_fld forOption: "sub-language" ];
[self setupField: o_osd_font_fld forOption: "quartztext-font"];
[self setupButton: o_osd_font_color_pop forIntList: "quartztext-color"];
[self setupButton: o_osd_font_size_pop forIntList: "quartztext-rel-fontsize"];
......@@ -755,6 +758,7 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
/* work-around a GCC 4.0.1 bug */
psz_tmp = (char *)[[NSString stringWithFormat: @"%s:volnorm", psz_tmp] UTF8String];
config_PutPsz( p_intf, "audio-filter", psz_tmp );
free( psz_tmp );
}
}
else
......@@ -762,10 +766,11 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
psz_tmp = config_GetPsz( p_intf, "audio-filter" );
if( psz_tmp )
{
psz_tmp = (char *)[[[NSString stringWithUTF8String: psz_tmp] stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:@":volnorm"]] UTF8String];
psz_tmp = (char *)[[[NSString stringWithUTF8String: psz_tmp] stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:@"volnorm:"]] UTF8String];
psz_tmp = (char *)[[[NSString stringWithUTF8String: psz_tmp] stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:@"volnorm"]] UTF8String];
char *psz_tmp2 = (char *)[[[NSString stringWithUTF8String: psz_tmp] stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:@":volnorm"]] UTF8String];
psz_tmp2 = (char *)[[[NSString stringWithUTF8String: psz_tmp2] stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:@"volnorm:"]] UTF8String];
psz_tmp2 = (char *)[[[NSString stringWithUTF8String: psz_tmp2] stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:@"volnorm"]] UTF8String];
config_PutPsz( p_intf, "audio-filter", psz_tmp );
free( psz_tmp );
}
}
config_PutFloat( p_intf, "norm-max-level", [o_audio_norm_fld floatValue] );
......
......@@ -749,7 +749,9 @@ static offscreen_bitmap_t *Compose( int i_text_align, UniChar *psz_utf16_str, ui
CGContextSetTextDrawingMode( p_context, kCGTextFillStroke );
CGContextSetShadow( p_context, CGSizeMake( 0, 0 ), 5 );
float black_components[4] = {0, 0, 0, 1};
CGContextSetShadowWithColor (p_context, CGSizeMake( 0, 0 ), 5, CGColorCreate( CGColorSpaceCreateWithName( kCGColorSpaceGenericRGB ), black_components ));
CGColorRef outlinecolor = CGColorCreate( CGColorSpaceCreateWithName( kCGColorSpaceGenericRGB ), black_components );
CGContextSetShadowWithColor (p_context, CGSizeMake( 0, 0 ), 5, outlinecolor);
CGColorRelease( outlinecolor );
do
{
// ATSUBreakLine will automatically pick up any manual '\n's also
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment