Browse Source
Merge pull request #4172 from AvaloniaUI/fix-xorg-dev-tools-timer-error
Fix dev tools crashing on X11.
pull/4177/head
Steven Kirk
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
2 deletions
-
src/Avalonia.Base/Threading/DispatcherTimer.cs
|
|
|
@ -14,7 +14,7 @@ namespace Avalonia.Threading |
|
|
|
private readonly DispatcherPriority _priority; |
|
|
|
|
|
|
|
private TimeSpan _interval; |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Initializes a new instance of the <see cref="DispatcherTimer"/> class.
|
|
|
|
/// </summary>
|
|
|
|
@ -154,6 +154,8 @@ namespace Avalonia.Threading |
|
|
|
TimeSpan interval, |
|
|
|
DispatcherPriority priority = DispatcherPriority.Normal) |
|
|
|
{ |
|
|
|
interval = (interval != TimeSpan.Zero) ? interval : TimeSpan.FromTicks(1); |
|
|
|
|
|
|
|
var timer = new DispatcherTimer(priority) { Interval = interval }; |
|
|
|
|
|
|
|
timer.Tick += (s, e) => |
|
|
|
@ -197,7 +199,7 @@ namespace Avalonia.Threading |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Raises the <see cref="Tick"/> event on the dispatcher thread.
|
|
|
|
|