Skip to content

Commit

Permalink
Memory leak fixes by Bill May.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jul 30, 2002
1 parent 9370aa3 commit 4419162
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/video/Xext/Xv/Xv.c
Expand Up @@ -395,6 +395,7 @@ SDL_NAME(XvQueryEncodings)(
*p_nEncodings = rep.num_encodings;
*p_pEncodings = pes;

Xfree(buffer);
UnlockDisplay(dpy);
SyncHandle();

Expand Down Expand Up @@ -978,7 +979,6 @@ SDL_NAME(XvImage) * SDL_NAME(XvCreateImage) (

UnlockDisplay(dpy);
SyncHandle();

return ret;
}

Expand Down
14 changes: 14 additions & 0 deletions src/video/x11/SDL_x11yuv.c
Expand Up @@ -36,6 +36,7 @@ static char rcsid =
#include <sys/shm.h>
#include <X11/extensions/XShm.h>
#include <XFree86/extensions/Xvlib.h>
#include <X11/Xlibint.h>

#include "SDL_error.h"
#include "SDL_video.h"
Expand Down Expand Up @@ -130,6 +131,19 @@ SDL_Overlay *X11_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, S
}
SDL_NAME(XvFreeAdaptorInfo)(ainfo);
}

/*
* !!! FIXME:
* "Here are some diffs for X11 and yuv. Note that the last part 2nd
* diff should probably be a new call to XvQueryAdaptorFree with ainfo
* and the number of adaptors, instead of the loop through like I did."
*/
for ( i=0; i < adaptors; ++i ) {
if (ainfo[i].name != NULL) Xfree(ainfo[i].name);
if (ainfo[i].formats != NULL) Xfree(ainfo[i].formats);
}
Xfree(ainfo);

if ( xv_port == -1 ) {
SDL_SetError("No available video ports for requested format");
return(NULL);
Expand Down

0 comments on commit 4419162

Please sign in to comment.