Merge pull request #145 from Frassle/throw

Preserve stack trace in OutOfMemory exception
This commit is contained in:
thefiddler 2014-06-23 08:48:36 +02:00
commit c8a5bf5e32

View file

@ -211,7 +211,7 @@ namespace OpenTK
Marshal.WriteIntPtr(ptr, i * IntPtr.Size, str); Marshal.WriteIntPtr(ptr, i * IntPtr.Size, str);
} }
} }
catch (OutOfMemoryException oom) catch (OutOfMemoryException)
{ {
for (i = i - 1; i >= 0; --i) for (i = i - 1; i >= 0; --i)
{ {
@ -220,7 +220,7 @@ namespace OpenTK
Marshal.FreeHGlobal(ptr); Marshal.FreeHGlobal(ptr);
throw oom; throw;
} }
} }
return ptr; return ptr;