[NUI] fix tct block issue in text field and editor
authorBowon Ryu <bowon.ryu@samsung.com>
Wed, 18 Jan 2023 06:37:40 +0000 (15:37 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 26 Apr 2023 01:53:38 +0000 (10:53 +0900)
GetInputMethodContext() in ReleaseSwigCPtr crashes due to current changes in BaseHandle.
Move DestroyContext() to Dispose to avoid this.

Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs
src/Tizen.NUI/src/public/BaseComponents/TextField.cs

index 1768538..6167335 100755 (executable)
@@ -2550,6 +2550,8 @@ namespace Tizen.NUI.BaseComponents
             }
 
             TextChanged -= TextEditorTextChanged;
+            GetInputMethodContext()?.DestroyContext();
+
             base.Dispose(type);
         }
 
@@ -2557,8 +2559,6 @@ namespace Tizen.NUI.BaseComponents
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
         {
-            // In order to speed up IME hide, temporarily add
-            GetInputMethodContext()?.DestroyContext();
             Interop.TextEditor.DeleteTextEditor(swigCPtr);
         }
 
index 0a4fa69..e40f98a 100755 (executable)
@@ -2556,6 +2556,7 @@ namespace Tizen.NUI.BaseComponents
             }
 
             TextChanged -= TextFieldTextChanged;
+            GetInputMethodContext()?.DestroyContext();
 
             base.Dispose(type);
         }
@@ -2564,8 +2565,6 @@ namespace Tizen.NUI.BaseComponents
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
         {
-            // In order to speed up IME hide, temporarily add
-            GetInputMethodContext()?.DestroyContext();
             Interop.TextField.DeleteTextField(swigCPtr);
         }