Crash at quit with Unity Trees in the scene - Workaround needed

First, the bug report is already sent. But that doesn´t really help me at the moment. I need at least a workaround until this issue is fixed. I cannot give my users a game with this massive bug.

The problem is, every time i quit the game the game crashes. At least when a Untiy tree was in the scene. When i remove the tree, then everyhting is fine. The app ends fine then. But when i load a level with trees then the app crashes at quit. Well, obviously i cannot delete my trees. They are part of the levels.

First i thougth i could come away with a simple workaround to load into a blank level first before quitting. But that doesnt help unfortunately. The game crashes at quit in every case after i have loaded the tree into memory. Seems that the trees doesnt unload from memory for some reasons.

As told, i search for a workaround. I have made a testcase. Start the exe version, quit immediately with Esc, and you will notice that all is fine. Now start the exe version and jump to the frame with the tree. Quit this frame with Esc, and you will get the crash. And it doesn`t help to go back to frame 0 and quit here instead of frame 1. This will also crash now.

Any ideas?

Testcase file, 13 Mb: http://www.reinerstilesets.de/ext/unity/quitcrashproblem.rar

Got the same problem, Unity crash on exit. As a workaround for you Exit button you can use System.Diagnostics.Process.GetCurrentProcess().Kill() instead of Application.Quit(),
But there is no workaround if user closes window in some other way.
Always crash on my development machine since 4.0, but not on my another laptop (everything the same, except Unity is not installed, but not sure how relevant it is) Win7 x64

Thanks montyfi, will try the kill () method and looks if that helps :slight_smile:

Interesting find that it doesnt crash at your other machine where Unity isnt installed. Maybe that helps the devs to catch the baddie.

Doesn´t work unfortunately. Well, the method itself works when i build the project immediately. But when i reload the project then i get an error: Assets/Scripts/nguimenu/globalvalues.js(90,56): BCE0019: ‘Kill’ is not a member of ‘System.Diagnostics.Process’. . And then i cannot go on until i have removed the code. Odd but true. Wonder why the error message appeared at reload, and not when i first implemented it.

Fortunately i got a mail that the crash bug is fixed in Unity 4.2. Which is excellent news. So i wait for 4.2 and look forward to it :slight_smile:

haha, Thanks montyfi, I try it and fix the crash