plug a memory leak in case of broken midis