Memory leak fixes by Bill May.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 30 Jul 2002 07:25:43 +0000
changeset 429c1666427297c
parent 428 1338c24e30cb
child 430 60effdbf14ee
Memory leak fixes by Bill May.
src/video/Xext/Xv/Xv.c
src/video/x11/SDL_x11yuv.c
     1.1 --- a/src/video/Xext/Xv/Xv.c	Mon Jul 29 23:20:16 2002 +0000
     1.2 +++ b/src/video/Xext/Xv/Xv.c	Tue Jul 30 07:25:43 2002 +0000
     1.3 @@ -395,6 +395,7 @@
     1.4    *p_nEncodings = rep.num_encodings;
     1.5    *p_pEncodings = pes;
     1.6  
     1.7 +  Xfree(buffer);
     1.8    UnlockDisplay(dpy);
     1.9    SyncHandle();
    1.10  
    1.11 @@ -978,7 +979,6 @@
    1.12  
    1.13     UnlockDisplay(dpy);
    1.14     SyncHandle();
    1.15 -
    1.16     return ret;
    1.17  }
    1.18  
     2.1 --- a/src/video/x11/SDL_x11yuv.c	Mon Jul 29 23:20:16 2002 +0000
     2.2 +++ b/src/video/x11/SDL_x11yuv.c	Tue Jul 30 07:25:43 2002 +0000
     2.3 @@ -36,6 +36,7 @@
     2.4  #include <sys/shm.h>
     2.5  #include <X11/extensions/XShm.h>
     2.6  #include <XFree86/extensions/Xvlib.h>
     2.7 +#include <X11/Xlibint.h>
     2.8  
     2.9  #include "SDL_error.h"
    2.10  #include "SDL_video.h"
    2.11 @@ -130,6 +131,19 @@
    2.12  		}
    2.13  		SDL_NAME(XvFreeAdaptorInfo)(ainfo);
    2.14  	}
    2.15 +
    2.16 +    /*
    2.17 +     * !!! FIXME:
    2.18 +     * "Here are some diffs for X11 and yuv.  Note that the last part 2nd
    2.19 +     *  diff should probably be a new call to XvQueryAdaptorFree with ainfo
    2.20 +     *  and the number of adaptors, instead of the loop through like I did."
    2.21 +     */
    2.22 + 	for ( i=0; i < adaptors; ++i ) {
    2.23 + 	  if (ainfo[i].name != NULL) Xfree(ainfo[i].name);
    2.24 + 	  if (ainfo[i].formats != NULL) Xfree(ainfo[i].formats);
    2.25 +   	}
    2.26 + 	Xfree(ainfo);
    2.27 +
    2.28  	if ( xv_port == -1 ) {
    2.29  		SDL_SetError("No available video ports for requested format");
    2.30  		return(NULL);