speckleworks / SpeckleCore

Check a brand new Speckle at: https://github.com/specklesystems
https://speckle.systems
MIT License
38 stars 17 forks source link

Web sockets getting created during the disposal of a client object. #146

Open pablothedolphin opened 4 years ago

pablothedolphin commented 4 years ago

Step 0:

SpeckleApiClient.Dispose () should just dispose the object with no errors.

Actual Behaviour

SpeckleApiClient.Dispose () triggers its onError callback with the event argument name simply being "websocket-disconnected". Still seems to work, but the error is unnecessary.

SpeckleApiClient.SetupWebsocket () is somehow being called when the client object gets disposed. This is regardless of whether or not true or false is passed into the dispose method.

Affected Projects

SpeckleUnity.

Reproduction Steps & System Config (win, osx, web, etc.)

Receive a stream and once it's received, I then try to dispose the client object and get thrown this error.

Proposed Solution (if any)

Try to avoid setting up a new web socket while disposing a client object.