Browse Source

Fixed bug in scheduler and runtime platform.

pull/790/head
Jeremy Koritzinsky 10 years ago
parent
commit
428466ced3
  1. 8
      src/Avalonia.Base/Threading/AvaloniaScheduler.cs
  2. 5
      src/Shared/PlatformSupport/StandardRuntimePlatform.cs

8
src/Avalonia.Base/Threading/AvaloniaScheduler.cs

@ -26,13 +26,7 @@ namespace Avalonia.Threading
/// <inheritdoc/>
public override IDisposable Schedule<TState>(TState state, TimeSpan dueTime, Func<IScheduler, TState, IDisposable> action)
{
return DispatcherTimer.Run(
() =>
{
action(this, state);
return false;
},
dueTime);
return DispatcherTimer.RunOnce(() => action(this, state), dueTime);
}
}
}

5
src/Shared/PlatformSupport/StandardRuntimePlatform.cs

@ -16,10 +16,7 @@ namespace Avalonia.Shared.PlatformSupport
public void PostThreadPoolItem(Action cb) => ThreadPool.UnsafeQueueUserWorkItem(_ => cb(), null);
public IDisposable StartSystemTimer(TimeSpan interval, Action tick)
{
var timer = new Timer(delegate
{
}, null, interval, interval);
var timer = new Timer(_ => tick(), null, interval, interval);
return Disposable.Create(() => timer.Dispose());
}

Loading…
Cancel
Save