[MPlayer-dev-eng] [PATCH] Better handling of win32 GUI thread

Erik Lunchpail erik_27can at yahoo.com
Sat Dec 1 23:09:20 CET 2007


--- Zuxy Meng <zuxy.meng at gmail.com> wrote:

> Hi,
> 
> 2007/11/1, Zuxy Meng <zuxy.meng at gmail.com>:
> > Hi,
> >
> > The attached patch contains two fixes:
> >
> > 1. Use _beginthreadex instead of CreateThread to create the thread
> so
> > as to avoid a small memory leak when mplayer is linked to MS CRT.
> >
> > 2. Remove the call to TerminateThread(). For one thing this isn't
> the
> > recommended way to terminate a thread; for another it's called with
> an
> > incorrect argument and therefore has always failed: the first
> > parameter should be a handle to the thread instead of the thread
> > function. And without this call the GUI thread will terminate
> itself
> > anyway once mygui == NULL.
> 
> Update patch that will free the GUI thread in a cleaner way.
> 

Although I agree it needs better thread handling, this broke the gui
functionality. The thread exits when you close any of the dialogs, the
main and sub window have lost almost all interaction with mplayer.

Erik



More information about the MPlayer-dev-eng mailing list