1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-10 17:09:45 +00:00

fix memleak

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7766 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
pontscho 2002-10-16 22:44:09 +00:00
parent 898e7af0fb
commit 0020017268
2 changed files with 7 additions and 3 deletions

View File

@ -362,9 +362,14 @@ static uint32_t config( uint32_t width,uint32_t height,uint32_t d_width,uint32_t
#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 )

View File

@ -290,7 +290,6 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32
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 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32
} 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);