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
tdll.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

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.