mirror of
https://github.com/dotMorten/NmeaParser.git
synced 2026-01-20 15:40:16 +01:00
Improve shutdown of device
This commit is contained in:
parent
7fa2a60340
commit
046427eafb
|
|
@ -130,10 +130,17 @@ namespace NmeaParser
|
|||
m_cts.Cancel();
|
||||
m_cts = null;
|
||||
}
|
||||
if (m_ParserTask != null)
|
||||
if (m_ParserTask != null && !m_ParserTask.IsCompleted)
|
||||
{
|
||||
await m_ParserTask;
|
||||
/*try
|
||||
{
|
||||
await m_ParserTask.ConfigureAwait(false);
|
||||
}
|
||||
catch { } // Ignore any exit errors*/
|
||||
}
|
||||
if (m_stream != null)
|
||||
await CloseStreamAsync(m_stream);
|
||||
await CloseStreamAsync(m_stream).ConfigureAwait(false);
|
||||
_lastMultiMessage = null;
|
||||
m_stream = null;
|
||||
lock (m_lockObject)
|
||||
|
|
|
|||
Loading…
Reference in a new issue