mkvsynth/mkvsynth — pull request #24 by lukechampine (2014-04-08 05:33:06+00:00)
Title: Memory 2: Electric Boogaloo

These changes plug almost all of the remaining memory leaks in delbrot. The majority of statements now do not leak a single byte. Pretty much the only leaky things remaining are if statements, ternary expressions and recursive functions that call `show`. (These may be fixed before this pull request is merged.)

The changes are entirely internal to delbrot, with one important exception: filters that use a `MANDSTR` string as one of their struct parameters must now duplicate that string. Why? Because delbrot will free those strings after the filter function returns, but the filter itself only runs when `go` is called, meaning the filter may wind up trying to use a previously freed string. To my knowledge, only `x264Encode` has this problem so far, so I've updated it to duplicate the string as described.