Skip to content
This repository has been archived by the owner on Nov 8, 2019. It is now read-only.

After destroying a GVRKeyboard component, adding a new one will crash Unity #918

Closed
Moncader opened this issue May 23, 2018 · 2 comments
Closed

Comments

@Moncader
Copy link

Summary:
Exactly as the title says.

Found using:

  • Google VR SDK version: v1.130.1
  • Unity version: 2018.1.0f2
  • Phone manufacturer, model, and O/S version: All Daydream devices
  • Viewer manufacturer & model: All Daydream Views

Steps to reproduce the issue:

  1. Add a GVRKeyboard component to a GameObject in a scene.
  2. Destroy that GameObject or GVRKeyboard component.
  3. Add another GVRKeyboard component to a GameObject in a scene.
  4. Unity will crash.

Workarounds:

--- a/Assets/GoogleVR/Scripts/Keyboard/GvrKeyboard.cs
+++ b/Assets/GoogleVR/Scripts/Keyboard/GvrKeyboard.cs
@@ -131,6 +131,8 @@ public class GvrKeyboard : MonoBehaviour {

   void OnDestroy() {
     instance = null;
+
+    threadSafeCallbacks.Clear();
   }

   // Use this for initialization.

The above will make everything work again.

@rusmaxham
Copy link
Contributor

Thanks for reporting this. This will be fixed in the next release.

@rusmaxham
Copy link
Contributor

This is now fixed in the latest release.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants