summaryrefslogtreecommitdiffstats
path: root/video/mp_image.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-01-16 11:35:37 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-01-18 00:59:07 -0800
commit1d3b680427a4a08d8e3df212eef74751fa56694e (patch)
treef61438a04528fb973e239c8354293e5f79097c16 /video/mp_image.c
parentcc3cdcb0f065eb0166acc664bb3c743c4bcd246b (diff)
downloadmpv-1d3b680427a4a08d8e3df212eef74751fa56694e.tar.bz2
mpv-1d3b680427a4a08d8e3df212eef74751fa56694e.tar.xz
options: simplify mp_get_config_group() memory management
There is some craziness here: the function allocates m_config_cache, which in turn allocates the actual option struct, which is what the function returns. The user would expect to be able to use talloc_free() to deallocate everything. Of course this didn't work, because the returned pointer is not the root parent in the talloc tree. But with some additional talloc craziness, this can be fixed. We rearrange the parent pointers such that freeing the option struct will free m_config_cache first, which uninits the contents in the option struct, but fortunately not the option struct itself. This change should simplify API use on the caller side, and reduce surprises.
Diffstat (limited to 'video/mp_image.c')
0 files changed, 0 insertions, 0 deletions