Skip to content

Commit

Permalink
[Core] Fixed disposing documents and settings
Browse files Browse the repository at this point in the history
  • Loading branch information
BAndysc committed Mar 16, 2021
1 parent 85c5614 commit 3fb30a2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions WoWDatabaseEditor/Managers/DocumentManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ public void OpenDocument(IDocument editor)
ActiveDocument = OpenedDocuments.Count > 0 ? OpenedDocuments[0] : null;
eventAggregator.GetEvent<DocumentClosedEvent>().Publish(editor);
editor.CloseCommand = origCommand;
if (editor is IDisposable disposable)
disposable.Dispose();
}
},
(context) => origCommand?.CanExecute(null) ?? true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ private void SaveAll()

public void Dispose()
{

foreach (var tab in ContainerTabItems)
{
if (tab is IDisposable disposable)
disposable.Dispose();
}
}

public string Title => "Settings";
Expand Down

0 comments on commit 3fb30a2

Please sign in to comment.