We’ve been working with unity for some time and we use asset-bundles for our content, recently we noticed this log on unity repeating itself a lot:
well, you get the point, anyways, when this happen it is common that the game ends up crashing, but it doesn’t happen all the time, so it’s hard to know what’s happening
anyone had this problem already, dealt with it or is still fighting it??
I get this error when I stop the editor from playing
I use
asset_bundles.Unload(false);
after all the requests to the asset bundle are executed.
The game works just fine, it’s just when I stop the editor that I get this error.
If i don’t call the Unload I get another error instead “Deleting persistent object without writing it first: customassetbundle-87ffe8b44f170d248a0448936433eb1b”
still have to open the bug, I’m currently investigating the causes and I’ve found out that is because I’m storing a component of the instantiated object in a class member.
Just a note, I’ve made this error go away by using AssetBundle.Unload(false); BEFORE the object I’ve instantiated has been destroyed. This, however, was causing a memory leak. Now I wait for the object to be destroyed and use AssetBundle.Unload(true); and the error “Deleting persistent…” has returned.
I’ve also encountered the error “Trying to reload asset from disk…” after changing Unload(true) to Unload(false). I found that when set to true, my objects were getting destroyed immediately without calling OnDestroy. Using Unload(false) corrected that, but now has created this new issue. I’ve set it back to Unload(true) and added a yield statement to wait for the destroy to finish. Not an ideal solution, but it works.
In our case, it started happening after fixing some upgrading Unity from 3.5.0b6 to 3.5.2f2 bundle bugs and it still happens in that 1 PC where the bugs were fixed plus in another fresh PC, on the tablet and on the mac - but it has no side effect other than flooding the Logs.
Also it returns me a slightly different second line: C:/BuildAgent/work/…/Runtime/Serialize/PersitentManager.cpp at line: 1115 - probably because it’s a newer Unity version.
Bug Report was already submitted, andeeee. You probably can reproduce it there.
I got this error if I kept references to objects in an AssetBundle (obtained through Load, LoadAll, etc). If I instead Instantiate the object and keep that one around, I don’t get the error.