File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ static async Task Main(string[] args)
5353 ManualResetEvent waitHandle = new ManualResetEvent ( false ) ;
5454 ManualResetEvent exitHandle = new ManualResetEvent ( false ) ;
5555 DnsWebService ? service = null ;
56+ PosixSignalRegistration ? psr = null ;
5657
5758 try
5859 {
@@ -86,9 +87,8 @@ static async Task Main(string[] args)
8687
8788 if ( Environment . OSVersion . Platform == PlatformID . Unix )
8889 {
89- PosixSignalRegistration . Create ( PosixSignal . SIGTERM , delegate ( PosixSignalContext context )
90+ psr = PosixSignalRegistration . Create ( PosixSignal . SIGTERM , delegate ( PosixSignalContext context )
9091 {
91- context . Cancel = true ;
9292 waitHandle . Set ( ) ;
9393 exitHandle . WaitOne ( ) ;
9494 } ) ;
@@ -107,6 +107,7 @@ static async Task Main(string[] args)
107107 Console . WriteLine ( "\r \n Technitium DNS Server is stopping..." ) ;
108108
109109 service ? . Dispose ( ) ;
110+ psr ? . Dispose ( ) ;
110111
111112 Console . WriteLine ( "Technitium DNS Server was stopped successfully." ) ;
112113 exitHandle . Set ( ) ;
You can’t perform that action at this time.
0 commit comments