[Multimedia] Modified ScreenMirroring to check whether object has been disposed of... 57/144857/1
authorcoderhyme <jhyo.kim@samsung.com>
Fri, 18 Aug 2017 07:07:32 +0000 (16:07 +0900)
committercoderhyme <jhyo.kim@samsung.com>
Fri, 18 Aug 2017 07:07:32 +0000 (16:07 +0900)
Change-Id: I944cc72391283c90280fcc779e9ba7bc16e91890
Signed-off-by: coderhyme <jhyo.kim@samsung.com>
src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroring.cs

index 7e98f84..de32341 100644 (file)
@@ -41,10 +41,7 @@ namespace Tizen.Multimedia.Remoting
         {
             get
             {
-                if (_disposed)
-                {
-                    throw new ObjectDisposedException(nameof(ScreenMirroring));
-                }
+                ThrowIfDisposed();
 
                 return _handle;
             }
@@ -138,6 +135,8 @@ namespace Tizen.Multimedia.Remoting
 
         internal void ThrowIfNotConnected()
         {
+            ThrowIfDisposed();
+
             if (IsConnected == false)
             {
                 throw new InvalidOperationException("ScreenMirroring is not connected.");
@@ -398,6 +397,14 @@ namespace Tizen.Multimedia.Remoting
             DetachDisplay();
         }
 
+        private void ThrowIfDisposed()
+        {
+            if (_disposed)
+            {
+                throw new ObjectDisposedException(nameof(ScreenMirroring));
+            }
+        }
+
         /// <summary>
         /// Releases all resource used by the <see cref="ScreenMirroring"/> object.
         /// </summary>