Mercurial > mplayer.hg
changeset 7765:dbf1e5cfadbd
fix memleak
author | pontscho |
---|---|
date | Wed, 16 Oct 2002 22:44:09 +0000 |
parents | 13c36b2d1d45 |
children | 52171f231d4d |
files | libvo/vo_x11.c libvo/vo_xv.c |
diffstat | 2 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/libvo/vo_x11.c Wed Oct 16 22:29:00 2002 +0000 +++ b/libvo/vo_x11.c Wed Oct 16 22:44:09 2002 +0000 @@ -362,9 +362,14 @@ #endif } + if ( vo_gc != None ) XFreeGC( mDisplay,vo_gc ); vo_gc=XCreateGC( mDisplay,vo_window,0L,&xgcv ); - if ( myximage ) freeMyXImage(); + if ( myximage ) + { + freeMyXImage(); + freeSwsContext(swsContext); + } getMyXImage(); if ( !WinID )
--- a/libvo/vo_xv.c Wed Oct 16 22:29:00 2002 +0000 +++ b/libvo/vo_xv.c Wed Oct 16 22:44:09 2002 +0000 @@ -290,7 +290,6 @@ num_buffers=vo_doublebuffering?(vo_directrendering?NUM_BUFFERS:2):1; /* check image formats */ - fo = XvListImageFormats(mDisplay, xv_port, (int*)&formats); xv_format=0; if(format==IMGFMT_BGR24) format=IMGFMT_YV12; for(i = 0; i < formats; i++){ @@ -387,7 +386,7 @@ } else if ( !(flags&1) ) XMoveResizeWindow( mDisplay,vo_window,hint.x,hint.y,hint.width,hint.height ); - + if ( vo_gc != None ) XFreeGC( mDisplay,vo_gc ); vo_gc = XCreateGC(mDisplay, vo_window, 0L, &xgcv); XFlush(mDisplay); XSync(mDisplay, False);