libplctag.NET icon indicating copy to clipboard operation
libplctag.NET copied to clipboard

Tag.Abort is throwing an exception

Open VitorKawao opened this issue 1 year ago • 7 comments

Hello,

I am using libplctag at version 1.6.0-alpha.3 and libplctag.NativeImport at version 2.0.0.0-alpha.5

If I stop my thread that was reading, it throws an exception at Tag.Abort

CoreCLR Version: 6.0.3624.51421 .NET Version: 6.0.36 Description: The process was terminated due to an unhandled exception. Exception Info: System.AggregateException: One or more errors occurred. (Cannot access a disposed object. Object name: 'libplctag.Tag'.) ---> System.ObjectDisposedException: Cannot access a disposed object. Object name: 'libplctag.Tag'. at libplctag.Tag.ThrowIfAlreadyDisposed() in //src/libplctag/Tag.cs:line 1085 at libplctag.Tag.Abort() in //src/libplctag/Tag.cs:line 657 at libplctag.Tag.<>c__DisplayClass134_0.<ReadAsync>b__0() in /_/src/libplctag/Tag.cs:line 817 at System.Threading.CancellationToken.<>c.<Register>b__12_0(Object obj) at System.Threading.CancellationTokenSource.Invoke(Delegate d, Object state, CancellationTokenSource source) at System.Threading.CancellationTokenSource.CallbackNode.<>c.<ExecuteCallback>b__9_0(Object s) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.CancellationTokenSource.CallbackNode.ExecuteCallback() at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException) --- End of inner exception stack trace --- at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException) at System.Threading.CancellationTokenSource.NotifyCancellation(Boolean throwOnFirstException) at System.Threading.CancellationTokenSource.TimerCallback(Object state) at System.Threading.TimerQueueTimer.Fire(Boolean isThreadPool) at System.Threading.TimerQueue.FireNextTimers()

My logs log.txt

Thank you, Vítor Guedes

VitorKawao avatar Feb 06 '25 18:02 VitorKawao