• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DemoBytom / DemoEngine / 22106801760

17 Feb 2026 04:32PM UTC coverage: 29.986% (+0.2%) from 29.787%
22106801760

Pull #502

coveralls.net

DemoBytom
Fixes #501 where `IMainLoopLifetime` was resolved from wrong scope

`IMainLoopLifetime` was resolved from different scope in `EngineService` than anywhere else within the services.

Fixes #501
Pull Request #502: Feature/small fixes

639 of 2131 relevant lines covered (29.99%)

0.33 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Demo.Engine.Core/Services/MainLoopLifetime.cs
1
// Copyright © Michał Dembski and contributors.
2
// Distributed under MIT license. See LICENSE file in the root for more information.
3

4
using Demo.Engine.Core.Interfaces;
5

6
namespace Demo.Engine.Core.Services;
7

8
internal sealed class MainLoopLifetime
9
    : IMainLoopLifetime,
10
      IDisposable
11
{
12
    private readonly CancellationTokenSource _loopCancellationTokenSource = new();
×
13
    //private bool _disposedValue;
14
    private int _disposedValue; //0 == false, anything else == true
15

16
    /// <inheritdoc cref="CancellationTokenSource.Cancel()"/>
17
    public void Cancel()
18
        => _loopCancellationTokenSource.Cancel();
×
19

20
    /// <inheritdoc cref="CancellationTokenSource.Token"/>
21
    public CancellationToken Token
22
        => _loopCancellationTokenSource.Token;
×
23

24
    private void Dispose(bool disposing)
25
    {
26
        if (Interlocked.Exchange(ref _disposedValue, 1) != 0)
×
27
        {
28
            return;
×
29
        }
30

31
        if (disposing)
×
32
        {
33
            _loopCancellationTokenSource.Dispose();
×
34
        }
35
    }
×
36

37
    public void Dispose()
38
    {
39
        // Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
40
        Dispose(disposing: true);
×
41
        GC.SuppressFinalize(this);
×
42
    }
×
43
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc