fixed a memory leak in mesh I managed to introduce while experimenting