-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate to .NET 5, other improvements
- Loading branch information
Rcmcpe
committed
Mar 26, 2020
1 parent
7abf0e1
commit 4ff9115
Showing
8 changed files
with
79 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,27 @@ | ||
using System; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Microsoft.Extensions.Configuration; | ||
using REVUnit.AutoArknights.Core; | ||
using REVUnit.Crlib.Extension; | ||
using REVUnit.Crlib.Input; | ||
|
||
namespace REVUnit.AutoArknights.CLI | ||
namespace REVUnit.AutoArknights.CLI | ||
{ | ||
public static class Entry | ||
{ | ||
public static void Main() | ||
{ | ||
var src = new CancellationTokenSource(); | ||
var task = new Task(() => | ||
{ | ||
using var app = new AutoArknights(); | ||
app.Run(); | ||
}, src.Token, TaskCreationOptions.LongRunning); | ||
XConsole.Exiting += () => | ||
{ | ||
src.Cancel(); | ||
Console.WriteLine("已释放非托管资源。"); | ||
Environment.Exit(0); | ||
}; | ||
task.Start(); | ||
task.Wait(src.Token); | ||
using var app = new AutoArknights(); | ||
app.Run(); | ||
// 经过实验,并不能释放非托管资源。 | ||
// TODO See https://github.com/CCRcmcpe/Auto-Arknights/issues/1 | ||
// var src = new CancellationTokenSource(); | ||
// var task = new Task(() => | ||
// { | ||
// using var app = new AutoArknights(); | ||
// app.Run(); | ||
// }, src.Token, TaskCreationOptions.LongRunning); | ||
// XConsole.Exiting += () => | ||
// { | ||
// src.Cancel(); | ||
// Console.WriteLine("已释放非托管资源。"); | ||
// Environment.Exit(0); | ||
// }; | ||
// task.Start(); | ||
// task.Wait(src.Token); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule Crlib
updated
from 9d24ec to 807c91
Submodule REVUnit.ImageLocator
updated
from 1adcba to 1757ba