I was able to identify and fix the memory leak when mining terrain - so here is the fix
100mb of leaked memory without the patch:

400 kilobytes after I made this hole, which is likely not a leak but just the general cost to keep the changed terrain loaded.
