Skip to content

Replaced destructor with Dispose(), and added InvalidOperationExcept…#1

Open
jacobvc wants to merge 1 commit intobatourin:mainfrom
jacobvc:protocol-processor-destructor
Open

Replaced destructor with Dispose(), and added InvalidOperationExcept…#1
jacobvc wants to merge 1 commit intobatourin:mainfrom
jacobvc:protocol-processor-destructor

Conversation

@jacobvc
Copy link

@jacobvc jacobvc commented Sep 27, 2021

In trying to use this library (in a windows Forms app) It hung on exit.

I determined that ViscaProtocolProcesser was blocked on close by the parseResponse thread that the destructor would have cancelled.

I was able to solve the issue by change the destructor to Dispose().

Once that was done, it failed with an InvalidOperationException. The OperationCancelledException was apparently changed to an invalid operation by an intervening object. Rather than mess with deeper code, I added a handler as a temporary solution for my problem.

I hope this is helpful.

…ion catch.

The destructor was never reached because the thread it was intended to cancel never ended.  The OperationCancelledException was apparently changed to an invalid operation by an intervening object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant