Reapplied memory leak patch to GameRegistry.