Skip to content

Commit

Permalink
Revert "X11 backend wont crash with 0 sized window."
Browse files Browse the repository at this point in the history
This reverts commit d491098.
  • Loading branch information
danwalmsley committed Jan 20, 2020
1 parent d491098 commit 9fc7842
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/Shared/PlatformSupport/StandardRuntimePlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,11 @@ static UnmanagedBlob()

public UnmanagedBlob(StandardRuntimePlatform plat, int size)
{
if (size > 0)
{
_plat = plat;
_address = plat.Alloc(size);
GC.AddMemoryPressure(size);
}

if (size <= 0)
throw new ArgumentException("Positive number required", nameof(size));
_plat = plat;
_address = plat.Alloc(size);
GC.AddMemoryPressure(size);
Size = size;
#if DEBUG
_backtrace = Environment.StackTrace;
Expand All @@ -77,7 +75,7 @@ void DoDispose()
lock (_btlock)
Backtraces.Remove(_backtrace);
#endif
_plat?.Free(_address, Size);
_plat.Free(_address, Size);
GC.RemoveMemoryPressure(Size);
IsDisposed = true;
_address = IntPtr.Zero;
Expand Down

0 comments on commit 9fc7842

Please sign in to comment.