Dispose of LibCef Drivers when done

This commit is contained in:
Timothy Baldridge 2020-04-20 16:36:11 -06:00
parent 324888a759
commit 840d4fcfb3
2 changed files with 7 additions and 2 deletions

View File

@ -31,7 +31,7 @@ namespace Wabbajack
{
var cancel = new CancellationTokenSource();
var oldPane = MainWindow.ActivePane;
var vm = await WebBrowserVM.GetNew();
using var vm = await WebBrowserVM.GetNew();
MainWindow.NavigateTo(vm);
vm.BackCommand = ReactiveCommand.Create(() =>
{

View File

@ -14,7 +14,7 @@ using Wabbajack.Lib.WebAutomation;
namespace Wabbajack
{
public class WebBrowserVM : ViewModel, IBackNavigatingVM
public class WebBrowserVM : ViewModel, IBackNavigatingVM, IDisposable
{
[Reactive]
public string Instructions { get; set; }
@ -38,5 +38,10 @@ namespace Wabbajack
// Make sure libraries are extracted first
return new WebBrowserVM(url);
}
public void Dispose()
{
Browser.Dispose();
}
}
}