The meshes custom data-mask edit-mode check only considered the object in edit-mode if it was the active object. This isn't correct as multiple objects can be in edit-mode at once. The potential for `mesh_get_eval_deform` to leak memory remains, this just avoids an unnecessary mesh re-generation on selection (which was causing the leak), see: !128228 for details.