^>(_taskCompletionSource, TimeSpan::FromMilliseconds(2000));
}
~PluginVisitor()
{
+ //In this case Visit was likely never called, so we set result to complete the task
+ if (_list->Count == 0)
+ {
+ _taskCompletionSource->SetResult(_list);
+ }
+
_list = nullptr;
_taskCompletionSource = nullptr;
}
diff --git a/CefSharp.Example/CefExample.cs b/CefSharp.Example/CefExample.cs
index 9c1c013d4..fe4fc739e 100644
--- a/CefSharp.Example/CefExample.cs
+++ b/CefSharp.Example/CefExample.cs
@@ -196,10 +196,19 @@ namespace CefSharp.Example
pluginBody.Append("| Path | ");
pluginBody.Append("");
- try
- {
- var plugins = await Cef.GetPlugins();
+ var plugins = await Cef.GetPlugins();
+ if(plugins.Count == 0)
+ {
+ pluginBody.Append("");
+ pluginBody.Append("| Cef.GetPlugins returned an empty list - likely no plugins were loaded on your system | ");
+ pluginBody.Append("
");
+ pluginBody.Append("");
+ pluginBody.Append("| You may find that NPAPI/PPAPI need to be enabled | ");
+ pluginBody.Append("
");
+ }
+ else
+ {
foreach (var plugin in plugins)
{
pluginBody.Append("");
@@ -210,15 +219,6 @@ namespace CefSharp.Example
pluginBody.Append("
");
}
}
- catch (TaskCanceledException ex)
- {
- pluginBody.Append("");
- pluginBody.Append("| Cef.GetPlugins Timed out - likely no plugins were loaded on your system | ");
- pluginBody.Append("
");
- pluginBody.Append("");
- pluginBody.Append("| You may find that NPAPI/PPAPI need to be enabled | ");
- pluginBody.Append("
");
- }
pluginBody.Append("