ssannandeji / Zenject-2019

Dependency Injection Framework for Unity3D
MIT License
2.53k stars 363 forks source link

Crash when validating scene in Unity 2019.1.0b1 #601

Closed schodemeiss closed 5 years ago

schodemeiss commented 5 years ago

When I run "Validate Scene" from the menu or the shortcut keys, the editor immediately crashes in Unity 2019.1.0b1.

It doesn't appear to produce any logs for me to submit, otherwise I'd attach them here (any ideas where I might find some)?

However, my project does run absolutely fine - it appears to just be a problem with the validation.

It's also worth noting the validation works perfectly on the exactly same project in the same state on 2018.3.

svermeulen commented 5 years ago

Yep I can reproduce this too. I'll take a look

schodemeiss commented 5 years ago

Can confirm still exists on 2019.1.0b2 as well.

svermeulen commented 5 years ago

This looks like a unity bug. It crashes on the line gameObj.transform.SetParent(parent, positionAndRotationWereSet); (line 1775) in DiContainer.cs. I've reproduced it down to the following code:

var parent1 = new GameObject("parent1");
parent1.hideFlags = HideFlags.HideAndDontSave;

var go = new GameObject("go");
go.transform.SetParent(parent1.transform);

var parent2 = new GameObject("parent2");
go.transform.SetParent(parent2.transform);

If this is executed in edit mode then the crash occurs. I've submitted this as a bug report to unity

schodemeiss commented 5 years ago

This appears to be fixed in 2019.2.0a8.