This function only makes sense for undo which doesn't initialize the meshes ID. Otherwise BKE_id_free should be used.