From: FrantiÅ¡ek DvoÅák <va...@us...> - 2008-11-27 17:44:46
|
Update of /cvsroot/xine/xine-ui/src/xitk In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3515/src/xitk Modified Files: actions.c actions.h main.c Log Message: Fixed memleaks and memory access bugs. Index: actions.c =================================================================== RCS file: /cvsroot/xine/xine-ui/src/xitk/actions.c,v retrieving revision 1.299 retrieving revision 1.300 diff -u -r1.299 -r1.300 --- actions.c 16 Nov 2008 17:06:36 -0000 1.299 +++ actions.c 27 Nov 2008 17:44:29 -0000 1.300 @@ -2310,6 +2310,12 @@ gGui->visual_anim.mrls[gGui->visual_anim.num_mrls] = NULL; gGui->visual_anim.mrls[gGui->visual_anim.num_mrls + 1] = NULL; } +void visual_anim_done(void) { + int i; + + for (i = 0; i < gGui->visual_anim.num_mrls; i++) free(gGui->visual_anim.mrls[i]); + free(gGui->visual_anim.mrls); +} void visual_anim_add_animation(char *mrl) { gGui->visual_anim.mrls = (char **) realloc(gGui->visual_anim.mrls, sizeof(char *) * ((gGui->visual_anim.num_mrls + 1) + 2)); Index: actions.h =================================================================== RCS file: /cvsroot/xine/xine-ui/src/xitk/actions.h,v retrieving revision 1.64 retrieving revision 1.65 diff -u -r1.64 -r1.65 --- actions.h 13 Nov 2007 21:12:17 -0000 1.64 +++ actions.h 27 Nov 2008 17:44:29 -0000 1.65 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2007 the xine project + * Copyright (C) 2000-2008 the xine project * * This file is part of xine, a unix video player. * @@ -103,6 +103,7 @@ void gui_file_selector(void); void gui_select_sub(void); void visual_anim_init(void); +void visual_anim_done(void); void visual_anim_add_animation(char *mrl); void visual_anim_play(void); void visual_anim_play_next(void); Index: main.c =================================================================== RCS file: /cvsroot/xine/xine-ui/src/xitk/main.c,v retrieving revision 1.349 retrieving revision 1.350 diff -u -r1.349 -r1.350 --- main.c 16 Nov 2008 17:06:36 -0000 1.349 +++ main.c 27 Nov 2008 17:44:29 -0000 1.350 @@ -753,11 +753,14 @@ #ifdef HAVE_XINERAMA if (XineramaQueryExtension(gGui->video_display, &dummy_event, &dummy_error)) { + void *info; int count = 1; - XineramaQueryScreens(gGui->video_display, &count); + + info = XineramaQueryScreens(gGui->video_display, &count); if (count > 1) /* multihead -> assuming square pixels */ gGui->pixel_aspect = 1.0; + if (info) XFree(info); } #endif @@ -2023,6 +2026,7 @@ pthread_mutexattr_init(&mutexattr); pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_RECURSIVE); pthread_mutex_init(&gGui->logo_mutex, &mutexattr); + pthread_mutexattr_destroy(&mutexattr); /* Automatically start playback if new_mode is enabled and playlist is filled */ if((gGui->smart_mode && @@ -2221,6 +2225,7 @@ gui_run(session_argv); + visual_anim_done(); free(pplugins); if(session_argv_num) { |