diff --git a/src/Tizen.NUI/src/internal/WebView/WebContext.cs b/src/Tizen.NUI/src/internal/WebView/WebContext.cs index c8bad400905..9a4469c7122 100755 --- a/src/Tizen.NUI/src/internal/WebView/WebContext.cs +++ b/src/Tizen.NUI/src/internal/WebView/WebContext.cs @@ -40,6 +40,8 @@ public class WebContext : Disposable private readonly WebContextPasswordDataListAcquiredProxyCallback passwordDataListAcquiredProxyCallback; private HttpRequestInterceptedCallback httpRequestInterceptedCallback; private readonly WebContextHttpRequestInterceptedProxyCallback httpRequestInterceptedProxyCallback; + private DownloadStartedCallback downloadStartedCallback; + private MimeOverriddenCallback mimeOverriddenCallback; internal WebContext(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) { @@ -518,10 +520,11 @@ public void GetFormPasswordList(PasswordDataListAcquiredCallback callback) [EditorBrowsable(EditorBrowsableState.Never)] public void RegisterDownloadStartedCallback(DownloadStartedCallback callback) { + downloadStartedCallback = callback; IntPtr ip = IntPtr.Zero; - if (callback != null) + if (downloadStartedCallback != null) { - ip = Marshal.GetFunctionPointerForDelegate(callback); + ip = Marshal.GetFunctionPointerForDelegate(downloadStartedCallback); } Interop.WebContext.RegisterDownloadStartedCallback(SwigCPtr, new HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -534,10 +537,11 @@ public void RegisterDownloadStartedCallback(DownloadStartedCallback callback) [EditorBrowsable(EditorBrowsableState.Never)] public void RegisterMimeOverriddenCallback(MimeOverriddenCallback callback) { + mimeOverriddenCallback = callback; IntPtr ip = IntPtr.Zero; - if (callback != null) + if (mimeOverriddenCallback != null) { - ip = Marshal.GetFunctionPointerForDelegate(callback); + ip = Marshal.GetFunctionPointerForDelegate(mimeOverriddenCallback); } Interop.WebContext.RegisterMimeOverriddenCallback(SwigCPtr, new HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/public/WebView/WebView.cs b/src/Tizen.NUI/src/public/WebView/WebView.cs index 94e127f2cb1..2a3fbe4d233 100755 --- a/src/Tizen.NUI/src/public/WebView/WebView.cs +++ b/src/Tizen.NUI/src/public/WebView/WebView.cs @@ -244,6 +244,10 @@ protected override void Dispose(DisposeTypes type) return; } + Context.RegisterDownloadStartedCallback(null); + Context.RegisterMimeOverriddenCallback(null); + Context.RegisterHttpRequestInterceptedCallback(null); + if (type == DisposeTypes.Explicit) { //Called by User