[ElmSharp] Fix SVACE warnings 36/151536/2 preview1-00233
authorWonyoung Choi <wy80.choi@samsung.com>
Thu, 21 Sep 2017 07:02:50 +0000 (16:02 +0900)
committerSeungkeun Lee <sngn.lee@samsung.com>
Thu, 21 Sep 2017 08:04:42 +0000 (17:04 +0900)
Layout.cs : the ClassName can be null. it should be checked before use.
Image.cs : the instance of "new MemoryStream()" should be disposed before end of function.
EvasImage.cs : the instance of "new MemoryStream()" should be disposed before end of function.

Change-Id: I069e1d6d1f5964f50164df97742317feeb26ca71

src/ElmSharp/ElmSharp/EvasImage.cs
src/ElmSharp/ElmSharp/Image.cs
src/ElmSharp/ElmSharp/Layout.cs

index 6ef6537..2bf9407 100644 (file)
@@ -222,6 +222,7 @@ namespace ElmSharp
                     Interop.Evas.evas_object_image_memfile_set(RealHandle, data, dataArr.Length, IntPtr.Zero, IntPtr.Zero);
                 }
             }
+            memstream.Dispose();
         }
 
         /// <summary>
index 5420e44..4f40932 100644 (file)
@@ -594,6 +594,8 @@ namespace ElmSharp
                 }
             }
 
+            memstream.Dispose();
+
             return await tcs.Task;
         }
 
index 9a45bbe..4e7b294 100644 (file)
@@ -304,7 +304,7 @@ namespace ElmSharp
         {
             set
             {
-                if (value.IsDefault)
+                if (value.IsDefault && ClassName != null)
                 {
                     string part = ClassName.ToLower().Replace("elm_", "") + "/" + "bg";
                     EdjeObject.DeleteColorClass(part);