[NUI] Add protect codes in Dispose() 00/165600/2
authoradun <xiaohui.fang@samsung.com>
Tue, 2 Jan 2018 18:47:08 +0000 (02:47 +0800)
committerdongsug song <dongsug.song@samsung.com>
Wed, 3 Jan 2018 11:21:18 +0000 (11:21 +0000)
Change-Id: I965de0e538e0b07a83a757e9c860fc11991f4903

13 files changed:
src/Tizen.NUI/src/public/Animation.cs
src/Tizen.NUI/src/public/BaseComponents/Scrollable.cs
src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs
src/Tizen.NUI/src/public/BaseComponents/TextField.cs
src/Tizen.NUI/src/public/BaseComponents/VideoView.cs
src/Tizen.NUI/src/public/BaseComponents/View.cs
src/Tizen.NUI/src/public/Timer.cs
src/Tizen.NUI/src/public/UIComponents/Button.cs
src/Tizen.NUI/src/public/UIComponents/Popup.cs
src/Tizen.NUI/src/public/UIComponents/ProgressBar.cs
src/Tizen.NUI/src/public/UIComponents/ScrollBar.cs
src/Tizen.NUI/src/public/UIComponents/ScrollView.cs
src/Tizen.NUI/src/public/UIComponents/Slider.cs

index f42b199a1bae2d74f2f757c6c99a92590250b659..c079d5ba946f252d80458806ac815eb451159d2a 100755 (executable)
@@ -53,15 +53,18 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         protected override void Dispose(DisposeTypes type)
         {
-            if (_animationFinishedEventCallback != null)
+            if (this != null)
             {
-                FinishedSignal().Disconnect(_finishedCallbackOfNative);
-            }
+                if (_animationFinishedEventCallback != null)
+                {
+                    FinishedSignal().Disconnect(_finishedCallbackOfNative);
+                }
 
-            if (_animationProgressReachedEventCallback != null)
-            {
+                if (_animationProgressReachedEventCallback != null)
+                {
 
-                ProgressReachedSignal().Disconnect(_animationProgressReachedEventCallback);
+                    ProgressReachedSignal().Disconnect(_animationProgressReachedEventCallback);
+                }
             }
 
             if(disposed)
index 83093a04b67e95eccc3fa42ba2b3168e44308eec..1d5c58901a82458c7e2940013ee288f1e1eb94da 100755 (executable)
@@ -63,8 +63,10 @@ namespace Tizen.NUI.BaseComponents
             //Release your own unmanaged resources here.
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
-
-            DisConnectFromSignals();
+            if (this != null)
+            {
+                DisConnectFromSignals();
+            }
 
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
index d918fda986056b86907579ca182e94cb5e292de8..e5a687cf78570233e26d54dc22ea559303ac8088 100755 (executable)
@@ -68,7 +68,7 @@ namespace Tizen.NUI.BaseComponents
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
-            if (_textEditorTextChangedCallbackDelegate != null)
+            if (this != null && _textEditorTextChangedCallbackDelegate != null)
             {
                 TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
             }
index 7684af79cd34133f9f1fb2c5f0de606d828ae00a..4175dae02b9a7450b5a3398dc23e256f6166fa41 100755 (executable)
@@ -67,15 +67,17 @@ namespace Tizen.NUI.BaseComponents
             //Release your own unmanaged resources here.
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
-
-            if (_textFieldMaxLengthReachedCallbackDelegate != null)
+            if (this != null)
             {
-                this.MaxLengthReachedSignal().Disconnect(_textFieldMaxLengthReachedCallbackDelegate);
-            }
+                if (_textFieldMaxLengthReachedCallbackDelegate != null)
+                {
+                    this.MaxLengthReachedSignal().Disconnect(_textFieldMaxLengthReachedCallbackDelegate);
+                }
 
-            if (_textFieldTextChangedCallbackDelegate != null)
-            {
-                TextChangedSignal().Disconnect(_textFieldTextChangedCallbackDelegate);
+                if (_textFieldTextChangedCallbackDelegate != null)
+                {
+                    TextChangedSignal().Disconnect(_textFieldTextChangedCallbackDelegate);
+                }
             }
 
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
index 4c15f399f01e56202072d4efad28bddc8f82ee36..f17dd45faf88771bc169b186ca49c3d76c161f17 100755 (executable)
@@ -61,7 +61,7 @@ namespace Tizen.NUI.BaseComponents
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
-            if (_videoViewFinishedCallbackDelegate != null)
+            if (this != null && _videoViewFinishedCallbackDelegate != null)
             {
                 FinishedSignal().Disconnect(_videoViewFinishedCallbackDelegate);
             }
index fe56b6483e9dfc0bf758dc149f08942d3888e003..78667e090202ca82a536a259e6c19ae4536bfefb 100755 (executable)
@@ -145,8 +145,10 @@ namespace Tizen.NUI.BaseComponents
             //Release your own unmanaged resources here.
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
-
-            DisConnectFromSignals();
+            if (this != null)
+            {
+                DisConnectFromSignals();
+            }
 
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
index 3ca9ff405adb7fce56dedcf95dda766b1cdaac63..52cb55405fe969e29ab018a120edf3b92615c83c 100755 (executable)
@@ -66,7 +66,7 @@ namespace Tizen.NUI
         {
             NUILog.Debug($"(0x{swigCPtr.Handle:X}) Timer.Dispose(type={type}, disposed={disposed})");
 
-            if (_timerTickCallbackDelegate != null)
+            if (this != null && _timerTickCallbackDelegate != null)
             {
                 TickSignal().Disconnect(_timerTickCallbackOfNative);
             }
index 636eddb4d7235fcccba3ed1f989b0d5227a829b0..8c5929366398bde5981c8a2df0681c9b9e9867a0 100755 (executable)
@@ -72,8 +72,10 @@ namespace Tizen.NUI.UIComponents
             //Release your own unmanaged resources here.
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
-
-            DisConnectFromSignals();
+            if (this != null)
+            {
+                DisConnectFromSignals();
+            }
 
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
index 3da49bf118b9d15e230ef8c699eff78e98ef2a85..0b81c5a0de0a47f8b40f360b7eb03fe741cda94e 100755 (executable)
@@ -62,15 +62,17 @@ namespace Tizen.NUI.UIComponents
             //Release your own unmanaged resources here.
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
-
-            if (_popUpHiddenEventCallbackDelegate != null)
+            if (this != null)
             {
-                HiddenSignal().Disconnect(_popUpHiddenEventCallbackDelegate);
-            }
+                if (_popUpHiddenEventCallbackDelegate != null)
+                {
+                    HiddenSignal().Disconnect(_popUpHiddenEventCallbackDelegate);
+                }
 
-            if (_popUpHidingEventCallbackDelegate != null)
-            {
-                HidingSignal().Disconnect(_popUpHidingEventCallbackDelegate);
+                if (_popUpHidingEventCallbackDelegate != null)
+                {
+                    HidingSignal().Disconnect(_popUpHidingEventCallbackDelegate);
+                }
             }
 
             if (_popUpShownEventCallbackDelegate != null)
index 3d889737b599a0d87564c1b0ff7c0c4dee13c486..4a280b32de5926f1f0491283069e206644a81aaf 100755 (executable)
@@ -63,7 +63,7 @@ namespace Tizen.NUI.UIComponents
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
-            if (_progressBarValueChangedCallbackDelegate != null)
+            if (this != null && _progressBarValueChangedCallbackDelegate != null)
             {
                 ValueChangedSignal().Disconnect(_progressBarValueChangedCallbackDelegate);
             }
index e2d752df1c5aa7470bc3d4bed06a9f6b70e72271..44c39def092970546abec1f6cdb7bf4b097deab4 100755 (executable)
@@ -61,15 +61,17 @@ namespace Tizen.NUI.UIComponents
             //Release your own unmanaged resources here.
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
-
-            if (_scrollBarScrollPositionIntervalReachedEventCallbackDelegate != null)
+            if (this != null)
             {
-                ScrollPositionIntervalReachedSignal().Disconnect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
-            }
+                if (_scrollBarScrollPositionIntervalReachedEventCallbackDelegate != null)
+                {
+                    ScrollPositionIntervalReachedSignal().Disconnect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
+                }
 
-            if (_scrollBarPanFinishedEventCallbackDelegate != null)
-            {
-                PanFinishedSignal().Disconnect(_scrollBarPanFinishedEventCallbackDelegate);
+                if (_scrollBarPanFinishedEventCallbackDelegate != null)
+                {
+                    PanFinishedSignal().Disconnect(_scrollBarPanFinishedEventCallbackDelegate);
+                }
             }
 
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
index cf4159b2b5bc53dc1286cfbacba8906c122c8fbf..3041525c71bf4b44e250605a072d7389f0af9124 100755 (executable)
@@ -64,7 +64,7 @@ namespace Tizen.NUI
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
-            if (_scrollViewSnapStartedCallbackDelegate != null)
+            if (this != null && _scrollViewSnapStartedCallbackDelegate != null)
             {
                 this.SnapStartedSignal().Disconnect(_scrollViewSnapStartedCallbackDelegate);
             }
index 5e7e51a769cabbde0cbe1b7965996a0cc7caf709..322cb4ac0c2474d3fc61132253f83e9d60307a22 100755 (executable)
@@ -62,20 +62,22 @@ namespace Tizen.NUI.UIComponents
             //Release your own unmanaged resources here.
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
-
-            if (_sliderValueChangedCallbackDelegate != null)
+            if (this != null)
             {
-                ValueChangedSignal().Disconnect(_sliderValueChangedCallbackDelegate);
-            }
+                if (_sliderValueChangedCallbackDelegate != null)
+                {
+                    ValueChangedSignal().Disconnect(_sliderValueChangedCallbackDelegate);
+                }
 
-            if (_sliderSlidingFinishedCallbackDelegate != null)
-            {
-                SlidingFinishedSignal().Disconnect(_sliderSlidingFinishedCallbackDelegate);
-            }
+                if (_sliderSlidingFinishedCallbackDelegate != null)
+                {
+                    SlidingFinishedSignal().Disconnect(_sliderSlidingFinishedCallbackDelegate);
+                }
 
-            if (_sliderMarkReachedCallbackDelegate != null)
-            {
-                MarkReachedSignal().Disconnect(_sliderMarkReachedCallbackDelegate);
+                if (_sliderMarkReachedCallbackDelegate != null)
+                {
+                    MarkReachedSignal().Disconnect(_sliderMarkReachedCallbackDelegate);
+                }
             }
 
             if (swigCPtr.Handle != global::System.IntPtr.Zero)