[MPlayer-dev-eng] [PATCH] Free GUI config

Reimar Döffinger Reimar.Doeffinger at gmx.de
Thu Apr 28 19:39:37 CEST 2011


On Thu, Apr 28, 2011 at 10:52:02AM +0200, Ingo Brückl wrote:
> Reimar Döffinger wrote on Wed, 27 Apr 2011 23:04:27 +0200:
> 
> > On Wed, Apr 27, 2011 at 07:24:34PM +0200, Ingo Brückl wrote:
> >> So far, it isn't freed.
> >>
> >> As non-gui files are affected, I better ask before committing. Since the
> >> GUI can abort with exit_player() this seems to be the right place.
> 
> > Not a big deal, however is there an advantage to freeing it that
> > justifies and additional CONFIG_GUI?
> > Freeing right before exit is after all a rather pointless thing to do,
> 
> Well, the advantage of freeing it is that allocated memory can be freed,
> isn't it?

It will be freed on application exit anyway, which is why some people
would call that "wasting lots of CPU cycles and energy to free them memory
1 ms earlier".
Obviously I don't fully agree with that, otherwise all those other
frees wouldn't be there either.

> Shouldn't there be a m_config_free() after GUI's m_config_new()
> and shouldn't it be done right before exit, i.e. before gmplayer ends and
> options are no longer needed?

Well, I am asking you why you think it should. Or rather, why it should enough
to justify adding Gui code there.

> If an error occurs before initialization is finished,
> guiDone() will never get called and thus the freeing will never be performed.
> In mplayer.c (with the CONFIG_GUI) it will be performed in any case.

When and why would that actually matter?
It all isn't a big deal but I'd really like to know why you want to change it.


More information about the MPlayer-dev-eng mailing list