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

Ingo Brückl ib at wupperonline.de
Thu Apr 28 10:52:02 CEST 2011


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? 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?

Does it justify an additional CONFIG_GUI? Considering this question and
trying to avoid the CONFIG_GUI I though GUI's own guiDone() could be a place
to free the config, but MPlayer first calls GUI's cfg_read() and later
initializes the GUI. 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.

Ingo


More information about the MPlayer-dev-eng mailing list