mode must be disposed when cancelled

This commit is contained in:
codeimp 2008-10-08 15:15:45 +00:00
parent ab28c9d66b
commit cef46a2386

View file

@ -172,10 +172,14 @@ namespace CodeImp.DoomBuilder.Editing
newmode = plugin.CreateObjectA<EditMode>(type, args);
// Switch mode
General.Map.ChangeMode(newmode);
if(!General.Map.ChangeMode(newmode))
{
// When cancelled, dispose mode
newmode.Dispose();
}
}
}
// String representation
public override string ToString()
{