Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 AndyMartin458 · Aug 07, 2013 at 06:32 PM · c#c++

How can I catch an Unahndled Null exception in a DLL?

Unity3D's log is not very helpful. It just says there is an unhandled null exception. I set up some try catch things around the function calls I thought might be the problem, but nothing is being caught.

Update-- I apologize for any confusion and didn't know what to include in the post.

This DLL is really a .bundle (for OSX, most people come from a windows background and think of everything as a DLL, me included) that is written and maintained by our company for use in assisting our Unity developers. It manages all of the audio for the game.

Generally, the project is run on an iPad where the XCode project has access to the native code without needing a bundle. After a lot of work to remove memory leaks, the iPad project does not exhibit any disruptive behavior. Specifically, when we call a function to stop and delete the class that is operated by the .bundle, the Unity editor crashes with "Receiving unhandled NULL exception, Launching bug reporter" but the iPad does not.

I can see the project in XCode's debugger when running on iPad which is immensely helpful. It would be awesome to attach the XCode debugger to the .bundle as it is operating in Unity. Do you have any similar advice like you did for Visual Studio? I'm wondering how to go about tracking down the bug in this .bundle.

Comment
Add comment · Show 13
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
avatar image Xtro · Aug 07, 2013 at 06:37 PM 0
Share

you should give more details

avatar image AndyMartin458 · Aug 07, 2013 at 06:46 PM 0
Share

It's a pretty open-ended question though. What is an unhandled null exception.

avatar image Xtro · Aug 07, 2013 at 06:49 PM 0
Share

I'm sorry to say that but, if you don't know what the null exception is, you shouldn't be developing a unity game. Please don't take me wrong. I suggest you to study on program$$anonymous$$g before making games.

avatar image AndyMartin458 · Aug 07, 2013 at 07:34 PM 0
Share

You don't know what you're talking about. I know exactly what a null reference exception is.

avatar image Xtro · Aug 08, 2013 at 02:23 AM 1
Share

Hmm. They passed the project to you but they didn't pass the source of the project? That feels bad :( But I know, it happens in professional life.

Show more comments

2 Replies

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

Answer by AndyMartin458 · Sep 06, 2013 at 06:19 AM

I did the impossible for this. I built a project that made all of these messages send through TCP. Now, I can debug the .bundle in Xcode while I'm running the game in the Unity editor. This is not a possibility when you are running in the Unity editor with a bundle using DLLImport for the functions. It revealed that a callback function was attempting to call a function after the .bundle had been deallocated. Quite the difficult problem.

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
avatar image
0

Answer by RalphTrickey · Aug 07, 2013 at 08:26 PM

I assume you're talking about a C++/Windows DLL. If not, you need to provide more information.

Unity doesn't do anything special here, try this site for some info. You should also be able to attach a c++ debugger to the DLL, start the DLL and use it to launch Unity and run the project. http://www.codeproject.com/Articles/207464/Exception-Handling-in-Visual-Cplusplus

http://msdn.microsoft.com/en-us/library/vstudio/ms164704.aspx

Comment
Add comment · Show 2 · 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
avatar image AndyMartin458 · Aug 07, 2013 at 08:40 PM 0
Share

It's actually a $$anonymous$$ac bundle. Any tips like this for XCode?

avatar image RalphTrickey · Aug 07, 2013 at 08:50 PM 0
Share

Sorry, I'm not a $$anonymous$$ac programmer.

You might try this and see if it helps. http://stackoverflow.com/questions/4720098/how-to-debug-dylib-with-xcode

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

16 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

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Using C++/CLR classes in C# plugins - GetExceptionPointers not implemented exception 0 Answers

Importing C++/CLI DLL causes errors 0 Answers

Illuminating a 3D object's edges OnMouseOver (script in c#)? 1 Answer


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