[Maps] Modify diposing routines
[platform/core/csapi/tizenfx.git] / src / Tizen.Maps / Tizen.Maps / PlaceCategory.cs
index 16ce43c..8c1d2cb 100755 (executable)
@@ -19,17 +19,17 @@ using System;
 namespace Tizen.Maps
 {
     /// <summary>
-    /// Place Category information, used in Place Discovery and Search requests
+    /// Place category information, used in place discovery and search requests.
     /// </summary>
-    /// <since_tizen>3</since_tizen>
+    /// <since_tizen> 3 </since_tizen>
     public class PlaceCategory : IDisposable
     {
         internal Interop.PlaceCategoryHandle handle;
 
         /// <summary>
-        /// Constructs search category object.
+        /// Constructs search category object.
         /// </summary>
-        /// <since_tizen>3</since_tizen>
+        /// <since_tizen> 3 </since_tizen>
         /// <exception cref="System.InvalidOperationException">Thrown when native operation failed to allocate memory.</exception>
         public PlaceCategory()
         {
@@ -41,11 +41,18 @@ namespace Tizen.Maps
             handle = nativeHandle;
         }
 
+        /// <summary>
+        /// Destroy the PlaceCategory object.
+        /// </summary>
+        ~PlaceCategory()
+        {
+            Dispose(false);
+        }
 
         /// <summary>
         /// Gets or sets an ID for this category.
         /// </summary>
-        /// <since_tizen>3</since_tizen>
+        /// <since_tizen> 3 </since_tizen>
         public string Id
         {
             get { return handle.Id; }
@@ -55,7 +62,7 @@ namespace Tizen.Maps
         /// <summary>
         /// Gets or sets a name for this category.
         /// </summary>
-        /// <since_tizen>3</since_tizen>
+        /// <since_tizen> 3 </since_tizen>
         public string Name
         {
             get { return handle.Name; }
@@ -63,9 +70,9 @@ namespace Tizen.Maps
         }
 
         /// <summary>
-        /// Gets or sets an URL for this category.
+        /// Gets or sets a URL for this category.
         /// </summary>
-        /// <since_tizen>3</since_tizen>
+        /// <since_tizen> 3 </since_tizen>
         public string Url
         {
             get { return handle.Url; }
@@ -75,7 +82,7 @@ namespace Tizen.Maps
         /// <summary>
         /// Returns a string that represents this object.
         /// </summary>
-        /// <since_tizen>3</since_tizen>
+        /// <since_tizen> 3 </since_tizen>
         /// <returns>Returns a string which presents this object.</returns>
         public override string ToString()
         {
@@ -85,19 +92,24 @@ namespace Tizen.Maps
         #region IDisposable Support
         private bool _disposedValue = false;
 
+        /// <summary>
+        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+        /// </summary>
+        /// <param name="disposing">If true, managed and unmanaged resources can be disposed, otherwise only unmanaged resources can be disposed.</param>
+        /// <since_tizen> 3 </since_tizen>
         protected virtual void Dispose(bool disposing)
         {
             if (!_disposedValue)
             {
-                handle.Dispose();
+                handle?.Dispose();
                 _disposedValue = true;
             }
         }
 
         /// <summary>
-        /// Releases all resources used by this object.
+        /// Releases all the resources used by this object.
         /// </summary>
-        /// <since_tizen>3</since_tizen>
+        /// <since_tizen> 3 </since_tizen>
         public void Dispose()
         {
             Dispose(true);