Skip to content

Commit

Permalink
Merge branch 'master' into android
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Walmsley committed Jan 21, 2021
2 parents 06a695c + f87464e commit d6fe20b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/Avalonia.Dialogs/AboutAvaloniaDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
<DrawingPresenter Drawing="{DynamicResource AvaloniaLogo}" />
</Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,-10,0,0">
<TextBlock Text="Avalonia 0.9" FontSize="40" Foreground="White" />
<TextBlock Text="Development Build" Margin="0,-10,0,0" FontSize="15" Foreground="White" />
<TextBlock Text="{Binding Version, StringFormat=Avalonia {0}}" FontSize="40" Foreground="White" />
<TextBlock Text="Development Build" IsVisible="{Binding IsDevelopmentBuild}" Margin="0,-10,0,0" FontSize="15" Foreground="White" />
</StackPanel>
</StackPanel>
<StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Center" Spacing="20" Margin="10 60 10 0">
Expand All @@ -102,4 +102,4 @@
<TextBlock Text="© 2020 The Avalonia Project" TextWrapping="Wrap" HorizontalAlignment="Center" />
</StackPanel>
</Grid>
</Window>
</Window>
9 changes: 8 additions & 1 deletion src/Avalonia.Dialogs/AboutAvaloniaDialog.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using Avalonia.Controls;
Expand All @@ -7,12 +8,18 @@ namespace Avalonia.Dialogs
{
public class AboutAvaloniaDialog : Window
{
private static readonly Version s_version = typeof(AboutAvaloniaDialog).Assembly.GetName().Version;

public static string Version { get; } = s_version.ToString(2);

public static bool IsDevelopmentBuild { get; } = s_version.Revision == 999;

public AboutAvaloniaDialog()
{
AvaloniaXamlLoader.Load(this);
DataContext = this;
}

public static void OpenBrowser(string url)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
Expand Down
20 changes: 14 additions & 6 deletions src/Shared/PlatformSupport/StandardRuntimePlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,20 @@ static UnmanagedBlob()

public UnmanagedBlob(StandardRuntimePlatform plat, int size)
{
if (size <= 0)
throw new ArgumentException("Positive number required", nameof(size));
_plat = plat;
_address = plat.Alloc(size);
GC.AddMemoryPressure(size);
Size = size;
try
{
if (size <= 0)
throw new ArgumentException("Positive number required", nameof(size));
_plat = plat;
_address = plat.Alloc(size);
GC.AddMemoryPressure(size);
Size = size;
}
catch
{
GC.SuppressFinalize(this);
throw;
}
#if DEBUG
_backtrace = Environment.StackTrace;
lock (_btlock)
Expand Down

0 comments on commit d6fe20b

Please sign in to comment.