Skip to content

Instantly share code, notes, and snippets.

@maynardflies
Created February 18, 2016 14:15
Show Gist options
  • Save maynardflies/b74f2d845311d70fefae to your computer and use it in GitHub Desktop.
Save maynardflies/b74f2d845311d70fefae to your computer and use it in GitHub Desktop.
Code which causes Environment.Exit hang
using System;
using System.Windows;
namespace CefSharp.MinimalExample.Wpf
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit;
}
void CurrentDomain_ProcessExit(object sender, EventArgs e)
{
Application.Current.Dispatcher.Invoke(new Action(Cef.Shutdown));
}
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
{
Environment.Exit(0);
}
}
}
@maynardflies
Copy link
Author

Created for cefsharp/CefSharp#990

@maynardflies
Copy link
Author

The hang occurs whether or not you call Shutdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment