pluxbiosignals / unity-sample

Unity Sample APP intended to show a practical integration of PLUX devices with the Unity environment, encompassing functionalities such as: the search of compatible Bluetooth devices and also the start/stop of a real-time acquisition.
15 stars 3 forks source link

Unity Editor Crashes on attempt to reconnect to same device after disconnecting #3

Closed ClaytonHughes closed 5 years ago

ClaytonHughes commented 5 years ago

Please see the related PR: https://github.com/biosignalsplux/unity-sample/pull/2

Running either CanInitTwice or CanInitTwiceWithDelay will cause the Unity Editor to crash (make sure your device is on). Running CanInitDestroy more than once causes the same crash.

Environment notes: tested on Unity x64 2018.3.11f1, Windows 10 (version 1809).

GRamosPlux commented 5 years ago

Dear ClaytonHughes,

Thank you very much for your helpful posts and for the very useful battery of conducted tests !

We replicated these conditions and in fact there was an undesirable behaviour due to a misplacement of a specific line of code (inside PluxDeviceManager.cs:DisconnectPluxDev function), essentially we were not destroying the object responsible for storing dealing with the connection between the computer and device, so, while reconnecting we were trying to pair with a device that was still connected.

In the new commit the first tests seems promising on fixing this issue, however, if you continue facing this undesirable bug, please, do not hesitate to reopen the discussion.

Your practical application of the Unity API are being extremely important for us to solve some undetected problems on the first release, we are continuously improving our work being your great contribution invaluable.

                  My best and sincere regards,
                  GRamosPlux