DX Crash, GFXDevice Crash

I am experiencing a crash consistently that prints to the unity logs the following information:

HandleD3DDeviceLost   HandleD3DDeviceLost: still lost Skipped rendering frame because GfxDevice is in invalid state (device lost)

I’ve searched and I’ve read and a lot of people associate this crash with Unity’s Multi-Threaded rendering, but I’ve turned this off and still find the crash.

I have no way to reproduce the crash I can only look at the logs around when it happened.

It would appear from the logs that the crash happens just after I clear unused assets with the following:

Resources.UnloadUnusedAssets();
 
System.GC.Collect();

In the logs this appears when it works as:

Unloading 1 unused Assets to reduce memory usage. Loaded Objects now: 377. Operation took 4.403515 ms.
Unloading 0 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

And when the crash occurs as:

Unloading 1 unused Assets to reduce memory usage. Loaded Objects now: 377. Operation took 4.344816 ms.
Skipped rendering frame because GfxDevice is in invalid state (device lost)
 
(Filename: C:/BuildAgent/work/14194e8ce88cdf47/Runtime/Misc/Player.cpp Line: 1617)

HandleD3DDeviceLost
  HandleD3DDeviceLost: still lost
Skipped rendering frame because GfxDevice is in invalid state (device lost)

The crash spams the logs until the application is shut down, The application is built for windows and is being tested on a Desktop running Windows XP Professional.

Can anyone shed some light on this?

EDIT
I don’t believe the gfxdevice crash is caused by any of the clearing memory code as I’ve changed it and the crash is still present.

Same problem and the deadline approaches !
:x

It’s very hard to know where, in code, the crash occur,
because it’s variable in time.
Sometimes, it take 2 seconds, sometimes 20seconds.
but it’s only when i Destroy() some GameObjects during runtime.

These gameObject just has 2 components :

  1. a C# script, which instanciate a second script, according to the checked booleans in inspector.
  2. a function from a DLL (instantiated by the previous c# script).

When i try to Destroy the components, without destroying the GameObject,
all is right.
If i Destroy the GameObject directly, i get a crash.
If i Destroy components, and (after) the gameObjetc, i get a crash.

:confused: