- Home /
Crash on Application.Quit() in standalone mode after closing window
I have a problem with a unity 2.6 application I have been working on for the last month. When I exit the app (With Application.Quit()) the application closes but (sometimes) I get and Exception when I return to windows complaining about crash. I've used BackgroundWorker class for threading in my app and i suspect this to be the problem, but again since the randomness of this exception I doubt that this is the problem?
During development I have switched between a trial pro version and a free version of unity3d. When I build with pro I get the standard 'trial version' in the right bottom corner. When switching to the free version of unity 2.6 and building I don't get the unity3d logo popping in which also seems strange to me. I haven't included the pro assets in my project in because of the switching between free and pro versions.
Is it me properly missing something while using threading Is this a bug in the unity3d or is it properly me missing something
I'm also calling Dispose() on my backgroundworker after it has completed the job. I have tried calling GC.Collect() explicitly to ensure deallocation of the backgroundworker.
I also use Itween alot which I don't really now the stability of.
Below is the error code from Windows EventViewer which wasn't to much help to me.
Hope you can help me!
Version=1
EventType=APPCRASH
EventTime=129297066013216220
ReportType=2
Consent=1
UploadTime=129297066013746250
ReportIdentifier=57dfad64-c6f2-11df-b1c1-002564d4f6ee
IntegratorReportIdentifier=57dfad63-c6f2-11df-b1c1-002564d4f6ee
WOW64=1
Response.type=4
Sig[0].Name=Programnavn
Sig[0].Value=ValveStandAlone.exe
Sig[1].Name=Programversion
Sig[1].Value=2.6.1.31223
Sig[2].Name=Tidsstempel for program
Sig[2].Value=4b13e2cb
Sig[3].Name=Fejlmodulnavn
Sig[3].Value=ntdll.dll
Sig[4].Name=Fejlmodulversion
Sig[4].Value=6.1.7600.16559
Sig[5].Name=Tidsstempel for fejlmodul
Sig[5].Value=4ba9b29c
Sig[6].Name=Undtagelseskode
Sig[6].Value=c0000005
Sig[7].Name=Undtagelsesforskydning
Sig[7].Value=00038c19
DynamicSig[1].Name=OS-version
DynamicSig[1].Value=6.1.7600.2.0.0.768.3
DynamicSig[2].Name=Landestandard-id
DynamicSig[2].Value=1030
UI[2]=C:\Program Files (x86)\3dValve\ValveStandAlone.exe
UI[3]=ValveStandAlone.exe er holdt op med at fungere
UI[4]=Windows kan sge online efter en lsning p problemet.
UI[5]=Sg efter en lsning p internettet, og luk programmet
UI[6]=Sg online efter en lsning senere, og luk programmet
UI[7]=Luk programmet
LoadedModule[0]=C:\Program Files (x86)\3dValve\ValveStandAlone.exe
LoadedModule[1]=C:\Windows\SysWOW64\ntdll.dll
LoadedModule[2]=C:\Windows\syswow64\kernel32.dll
LoadedModule[3]=C:\Windows\syswow64\KERNELBASE.dll
LoadedModule[4]=C:\Windows\syswow64\USER32.dll
LoadedModule[5]=C:\Windows\syswow64\GDI32.dll
LoadedModule[6]=C:\Windows\syswow64\LPK.dll
LoadedModule[7]=C:\Windows\syswow64\USP10.dll
LoadedModule[8]=C:\Windows\syswow64\msvcrt.dll
LoadedModule[9]=C:\Windows\syswow64\ADVAPI32.dll
LoadedModule[10]=C:\Windows\SysWOW64\sechost.dll
LoadedModule[11]=C:\Windows\syswow64\RPCRT4.dll
LoadedModule[12]=C:\Windows\syswow64\SspiCli.dll
LoadedModule[13]=C:\Windows\syswow64\CRYPTBASE.dll
LoadedModule[14]=C:\Windows\syswow64\SHELL32.dll
LoadedModule[15]=C:\Windows\syswow64\SHLWAPI.dll
LoadedModule[16]=C:\Windows\syswow64\ole32.dll
LoadedModule[17]=C:\Windows\system32\VERSION.dll
LoadedModule[18]=C:\Windows\system32\OPENGL32.dll
LoadedModule[19]=C:\Windows\system32\GLU32.dll
LoadedModule[20]=C:\Windows\system32\DDRAW.dll
LoadedModule[21]=C:\Windows\system32\DCIMAN32.dll
LoadedModule[22]=C:\Windows\syswow64\SETUPAPI.dll
LoadedModule[23]=C:\Windows\syswow64\CFGMGR32.dll
LoadedModule[24]=C:\Windows\syswow64\OLEAUT32.dll
LoadedModule[25]=C:\Windows\syswow64\DEVOBJ.dll
LoadedModule[26]=C:\Windows\system32\dwmapi.dll
LoadedModule[27]=C:\Windows\system32\WINMM.dll
LoadedModule[28]=C:\Windows\syswow64\WS2_32.dll
LoadedModule[29]=C:\Windows\syswow64\NSI.dll
LoadedModule[30]=C:\Windows\system32\DINPUT.dll
LoadedModule[31]=C:\Windows\system32\MSACM32.dll
LoadedModule[32]=C:\Windows\system32\apphelp.dll
LoadedModule[33]=C:\Windows\AppPatch\AcXtrnal.DLL
LoadedModule[34]=C:\Windows\system32\IMM32.DLL
LoadedModule[35]=C:\Windows\syswow64\MSCTF.dll
LoadedModule[36]=C:\Windows\system32\uxtheme.dll
LoadedModule[37]=C:\Windows\syswow64\CLBCatQ.DLL
LoadedModule[38]=C:\Windows\system32\wbem\wbemprox.dll
LoadedModule[39]=C:\Windows\system32\wbemcomn.dll
LoadedModule[40]=C:\Windows\system32\CRYPTSP.dll
LoadedModule[41]=C:\Windows\system32\rsaenh.dll
LoadedModule[42]=C:\Windows\system32\RpcRtRemote.dll
LoadedModule[43]=C:\Windows\system32\wbem\wbemsvc.dll
LoadedModule[44]=C:\Windows\system32\wbem\fastprox.dll
LoadedModule[45]=C:\Windows\system32\NTDSAPI.dll
LoadedModule[46]=C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7600.16385_none_421189da2b7fabfc\comctl32.dll
LoadedModule[47]=C:\Windows\syswow64\WINTRUST.dll
LoadedModule[48]=C:\Windows\syswow64\CRYPT32.dll
LoadedModule[49]=C:\Windows\syswow64\MSASN1.dll
LoadedModule[50]=C:\Windows\System32\MMDevApi.dll
LoadedModule[51]=C:\Windows\System32\PROPSYS.dll
LoadedModule[52]=C:\Windows\system32\wdmaud.drv
LoadedModule[53]=C:\Windows\system32\ksuser.dll
LoadedModule[54]=C:\Windows\system32\AVRT.dll
LoadedModule[55]=C:\Windows\system32\AUDIOSES.DLL
LoadedModule[56]=C:\Windows\system32\msacm32.drv
LoadedModule[57]=C:\Windows\system32\midimap.dll
FriendlyEventName=Handlingen blev afbrudt
ConsentKey=APPCRASH
AppName=ValveStandAlone.exe
AppPath=C:\Program Files (x86)\3dValve\ValveStandAlone.exe
I've also observed my standalones crashing on shutdown (Alt-F4) occasionally in Windows XP. However, you've already investigated it further than I have, so I don't have much else to offer. (So far, I haven't been able to figure out how to reproduce the behavior consistently.)
I have found a temporal solution where I use the .Net Process kill() function to shutdown my application (process) in standalone mode. This shuts it down without givin the user error messages after the application is ter$$anonymous$$ated.
Answer by Rasmus Schlnsen · Sep 25, 2010 at 03:17 PM
This is really not a proper answer but it keeps the errors away.
Instead of using
Application.Quit();
... I use this crummy hack
System.Diagnostics.Process.GetCurrentProcess().Kill();
resulting in no errors on exit time. I'm still looking into what is causing the errors on exit time, but this hack will do the job if you are in a hurry.
The release of Unity 3 have solved my problem, and I can now use Application.Quit() as normal without any errors. Still curious about what caused the exception though...
This hack to have fixed our problem as well. I know this is an old thread but apparently still relevant. This issue has been around a long time to be so see$$anonymous$$gly part of core functionality (exiting the game). Actually this bug seems to be specific to the Windows standalone player. On the $$anonymous$$ac it barfs all sorts of nasty stuff to the log after exit is called but it finally does exit with no crash. On Windows it just takes a dump and sometimes freezes the application.
Be carefull this hack will work ith the Editor, which means, that it will force Unity shutdown at once(save your stuff!)
if (!Application.isEditor) System.Diagnostics.Process.GetCurrentProcess().$$anonymous$$ill();
Your answer
Follow this Question
Related Questions
Are coroutines freezing my game? 0 Answers
How do I report a bug in Unity? 2 Answers