/[gr2lib]/trunk/gr2lib/core/coretypes/implementation/Map.cs
ViewVC logotype

Diff of /trunk/gr2lib/core/coretypes/implementation/Map.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/gr2lib/core/coretypes/implementation/Map.cs	2010/07/16 23:34:41	85
+++ trunk/gr2lib/core/coretypes/implementation/Map.cs	2010/07/16 23:35:21	86
@@ -16,19 +16,35 @@
         }
         internal static Map ReadFromMemory(IntPtr pointer)
         {
+            try 
+            {
             if (pointer == IntPtr.Zero) return null;
             native.Map native = Helpers.ReadFromMemory<native.Map>(pointer);
             Map managed = ReadFromNative(native);
             managed.NativePointer = pointer;
             return managed;
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.ToString());
+                return default(Map);
+            }
         }
 
         internal static Map ReadFromNative(native.Map native)
         {
+            try 
+            {
             Map managed = new Map();
             managed.Usage = native.Usage;
             managed.MapPointer = native.MapPointer;
             return managed;
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.ToString());
+                return default(Map);
+            }
         }
 
         #region INativePointer Members

 

  ViewVC Help
Powered by ViewVC 1.1.22