Revert "Async call sometimes crash because NullReferenceException at <BeginShow>b__0()"

This reverts commit b0e4f19491.
This commit is contained in:
Paddy Xu
2017-12-21 18:54:24 +02:00
parent b0e4f19491
commit f0990faa56

View File

@@ -192,15 +192,19 @@ namespace QuickLook
ShowWindowCaptionContainer(null, null);
//WindowHelper.SetActivate(new WindowInteropHelper(this), ContextObject.CanFocus);
// load plugin, sync
try
{
Plugin.View(path, ContextObject);
}
catch (Exception e)
{
exceptionHandler(path, ExceptionDispatchInfo.Capture(e));
}
// load plugin, do not block UI
Dispatcher.BeginInvoke(new Action(() =>
{
try
{
Plugin.View(path, ContextObject);
}
catch (Exception e)
{
exceptionHandler(path, ExceptionDispatchInfo.Capture(e));
}
}),
DispatcherPriority.Input);
}
private void SetOpenWithButtonAndPath()