mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-31 04:40:55 +00:00
mode must be disposed when cancelled
This commit is contained in:
parent
ab28c9d66b
commit
cef46a2386
1 changed files with 6 additions and 2 deletions
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue