From 86c72ea1ebe49612e3fffe41f5336f0385da72d7 Mon Sep 17 00:00:00 2001 From: jankurianski Date: Fri, 4 Sep 2015 14:17:10 +1000 Subject: [PATCH] Do not self-dispose CefCallbackWrapper Because ResourceHandlerWrapper already takes care of this. Fixes AccessViolationException noted in #1143 --- CefSharp.Core/Internals/CefCallbackWrapper.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CefSharp.Core/Internals/CefCallbackWrapper.h b/CefSharp.Core/Internals/CefCallbackWrapper.h index e8cdf34d5..46a850f17 100644 --- a/CefSharp.Core/Internals/CefCallbackWrapper.h +++ b/CefSharp.Core/Internals/CefCallbackWrapper.h @@ -42,8 +42,6 @@ namespace CefSharp ThrowIfDisposed(); _callback->Cancel(); - - delete this; } virtual void Continue() @@ -52,7 +50,10 @@ namespace CefSharp _callback->Continue(); - delete this; + // Do not self-dispose here or in Cancel because ResourceHandlerWrapper + // already has a reference to this callback and will take care + // of its disposal. See GitHub issue #1143 for a repro of an + // AccessViolationException caused by self-disposal. } }; }