Patch from Ben Hutchings to prevent memory leakage during Loopy game