From 8a144050ee45af33fc35d986ceff7118254b51b3 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 31 Aug 2017 18:13:01 +0200 Subject: [PATCH] WPF: Possible fix for NullReferenceException in OnTooltipTimerTick Resolves #2134 --- CefSharp.Wpf/ChromiumWebBrowser.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CefSharp.Wpf/ChromiumWebBrowser.cs b/CefSharp.Wpf/ChromiumWebBrowser.cs index 88d67b606..a2ac6435f 100644 --- a/CefSharp.Wpf/ChromiumWebBrowser.cs +++ b/CefSharp.Wpf/ChromiumWebBrowser.cs @@ -1905,9 +1905,13 @@ namespace CefSharp.Wpf /// The instance containing the event data. private void OnTooltipTimerTick(object sender, EventArgs e) { - tooltipTimer.Stop(); + // Checks to see if the control is disposed/disposing + if (Interlocked.CompareExchange(ref disposeCount, 1, 1) != 1) + { + tooltipTimer.Stop(); - UpdateTooltip(TooltipText); + UpdateTooltip(TooltipText); + } } ///