Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by unity_B2XGWtBRxTJexQ · Oct 23, 2017 at 03:07 PM · editorcrashingstartcoroutine errorsonapplicationquit

Using Phidgets the Editor crashes on second play from acces read violation, execption code 0xC0000005

I wrote a script for reading out a phidget. With the data i control a simple ball, whenever i press play it works without a problem. But after quitting the play mode waiting a few sec and pressing start again the editor will crash and give de read violation.

alt text

This is thread is probably the cause of the problem.

  //Separate thread to start Phidget connection
     private IEnumerator PhidgetThread()
     {
         try
         {
             ifk_DI = new DigitalInput[8];
             ifk_DO = new DigitalOutput[8];
             ifk_AI = new VoltageInput[8];
 
             for (int i = 0; i < 8; i++)
             {
                 ifk_DI[i] = new DigitalInput();
                 ifk_DI[i].Channel = i;
                 ifk_DI[i].Open(5000);
 
                 ifk_DO[i] = new DigitalOutput();
                 ifk_DO[i].Channel = i;
                 ifk_DO[i].Open(5000);
 
                 ifk_AI[i] = new VoltageInput();
                 ifk_AI[i].Channel = i;
                 ifk_AI[i].Open(5000);
                 ifk_AI[i].DataInterval = 2;
             }
             Debug.Log("Controller is ready for use");
         }
         catch (PhidgetException ex)
         {
             for (int i = 0; i < 8; i++)
             {
                 if (ifk_DI[i] != null || ifk_DO[i] != null || ifk_AI[i] != null)
                 {
                     ifk_DI[i].Close();
                     ifk_DO[i].Close();
                     ifk_AI[i].Close();
                 }    
             }
             Debug.Log("I has errors");
             Debug.LogError(ex.Message);
 
         }
         Debug.Log("Yield break");
         yield break;
     }

the onapplicationquit with the following code to close the channels.

     private void OnApplicationQuit()
     {
         for (int i = 0; i < 8; i++)
         {
             ifk_DI[i].Close();
             ifk_DO[i].Close();
             ifk_AI[i].Close();
         }
  
         Debug.Log("All channels are closed");
       
     }


capture.png (7.2 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by unity_B2XGWtBRxTJexQ · Oct 25, 2017 at 07:34 AM

The problem is fixed. Apperently it just had something to do with updating Unity since it was some kind of memory leak in the mono-2.0-bdwgc.dll.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

93 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Initialising List array for use in a custom Editor 1 Answer

Can I auto run a script when editor launches or a project finishes loading? 4 Answers

Apparent Problem with smartfox crashing unity editor 0 Answers

unity3d editor crashes a lot. Is there a preferences reset 0 Answers

Editor Crash : nvwgf2um.dll caused an Access Violation 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges