diff options
author | wm4 <wm4@nowhere> | 2019-07-13 20:27:32 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-09-19 20:37:05 +0200 |
commit | 36dd2348a1e118b44fcccd3c664af7c5f960b6bb (patch) | |
tree | 548c2f6e78ad319fd1510c459f2fc4af9c8e6123 /video/decode | |
parent | 0edccfd820e4812ed52cea85109f80ca13f74e97 (diff) | |
download | mpv-36dd2348a1e118b44fcccd3c664af7c5f960b6bb.tar.bz2 mpv-36dd2348a1e118b44fcccd3c664af7c5f960b6bb.tar.xz |
ta: destroy/free children in reverse order
This matters when talloc allocations set destructors. Before this
commit, destructors were called in the same order as they were added to
the parent allocations. Now it happens in reverse order.
I think this makes more sense. It's reasonable to assume that an
allocation that was added later may depend on any of the previous
allocations, so later additions should be destroyed first. (Of course
other orders are entirely possible too.)
Hopefully this doesn't fix or break anything, but I can't be sure (about
either of those). It's risky. (Then why do it?)
The destructor of a parent allocation is called before its children. It
makes sense and must stay this way, because in most cases, the
destructor wants to access the children.
This is a reason why I don't really like talloc (it wasn't my idea to
use talloc, is my excuse). Quite possible that destructors should be
removed from talloc entirely. Actually, this project should probably be
rewritten in Rust (or a better language), but that would be even more of
a pain; also, I think this is just the right level of suffering and
punishment.
Diffstat (limited to 'video/decode')
0 files changed, 0 insertions, 0 deletions