# HG changeset patch # User iive # Date 1100530578 0 # Node ID 3dbebe82fc378d05770d316c250d5849e95728fc # Parent bcdf8a05ad45d1087c87f18a07b44bb9919093c9 3 memory leaks fixed Xlib funtions allocate memory that should be freed appropriately diff -r bcdf8a05ad45 -r 3dbebe82fc37 libvo/vo_xv.c --- a/libvo/vo_xv.c Mon Nov 15 13:14:02 2004 +0000 +++ b/libvo/vo_xv.c Mon Nov 15 14:56:18 2004 +0000 @@ -68,7 +68,7 @@ static unsigned int ver, rel, req, ev, err; static unsigned int formats, adaptors, xv_port, xv_format; static XvAdaptorInfo *ai = NULL; -static XvImageFormatValues *fo; +static XvImageFormatValues *fo=NULL; static int current_buf = 0; static int current_ip_buf = 0; @@ -761,6 +761,10 @@ return; XvFreeAdaptorInfo(ai); ai = NULL; + if(fo){ + XFree(fo); + fo=NULL; + } for (i = 0; i < num_buffers; i++) deallocate_xvimage(i); #ifdef HAVE_XF86VM @@ -878,7 +882,7 @@ { int howmany, i; - const XvAttribute *const attributes = + XvAttribute * const attributes = XvQueryPortAttributes(mDisplay, xv_port, &howmany); for (i = 0; i < howmany && attributes; i++) @@ -889,6 +893,7 @@ XvSetPortAttribute(mDisplay, xv_port, autopaint, 1); break; } + XFree(attributes); } fo = XvListImageFormats(mDisplay, xv_port, (int *) &formats); diff -r bcdf8a05ad45 -r 3dbebe82fc37 libvo/x11_common.c --- a/libvo/x11_common.c Mon Nov 15 13:14:02 2004 +0000 +++ b/libvo/x11_common.c Mon Nov 15 14:56:18 2004 +0000 @@ -178,6 +178,7 @@ XFreeCursor(disp, no_ptr); if (bm_no != None) XFreePixmap(disp, bm_no); + XFreeColors(disp,colormap,&black.pixel,1,0); } void vo_showcursor(Display * disp, Window win)