Search Issue Tracker

Fixed in 2021.1.X

Votes

0

Found in

2019.3.0a12

Issue ID

1228706

Regression

No

Stylesheet can be garbage collected but still tried to be used in UIElement

HD RP

-

When the "Look Dev" window is opened and the High Definition RP package is upgraded from 7.1.8 to 7.2.0/7.2.1 , causes the editor to throw multiple exceptions continuously and "Look Dev" window turns to white, refer the attached video.

Steps to repro:
1. Create a new project with HDRP Template
2. Window > Render Pipeline > Look Dev
3. Keep "Look Dev" window opened
4. Be sure to not have collab as it can cause issue hidding this one
5. Upgrade HDRP package from 7.1.8 to 7.2.1

Actual Result:
Exceptions are thrown on upgrading HDRP package from 7.1.8 to 7.2.1 and everything go white in the window.

Expected Result:
Upgrading package doesn't affect anything to "Look Dev" window

Note: "Look Dev" window is introduced in Unity 2019.3.0a12. The bug can have existed prior this.

Reproducible in:
2020.1.0a24, 2019.3.2f1, 2019.3.0a12

Note: do not try this step to reproduce with 2020 beta as the 7.x.x package are not available anymore.

Environment:
Windows 10 and macOS 10.14

See former version of this bug here: https://fogbugz.unity3d.com/f/cases/1219692/ (include this issue and another one that will be fixed.)

CallStack:
MissingReferenceException: The object of type 'StyleSheet' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Object.get_name () (at <94c5f4c38cdc42d2b006f8badef04394>:0)
UnityEngine.UIElements.StyleSheets.StyleSheetCache.GetPropertyID (UnityEngine.UIElements.StyleSheet sheet, UnityEngine.UIElements.StyleRule rule, System.Int32 index) (at <57fa7f4ad1c34ed185465e0a9f71c244>:0)
UnityEngine.UIElements.StyleSheets.StyleSheetCache.GetPropertyIDs (UnityEngine.UIElements.StyleSheet sheet, System.Int32 ruleIndex) (at <57fa7f4ad1c34ed185465e0a9f71c244>:0)
UnityEngine.UIElements.StyleSheets.StylePropertyReader.SetContext (UnityEngine.UIElements.StyleSheet sheet, UnityEngine.UIElements.StyleComplexSelector selector, UnityEngine.UIElements.StyleVariableContext varContext, System.Single dpiScaling) (at <57fa7f4ad1c34ed185465e0a9f71c244>:0)
UnityEngine.UIElements.VisualTreeStyleUpdaterTraversal.ProcessMatchedRules (UnityEngine.UIElements.VisualElement element, System.Collections.Generic.List`1[T] matchingSelectors) (at <57fa7f4ad1c34ed185465e0a9f71c244>:0)
UnityEngine.UIElements.VisualTreeStyleUpdaterTraversal.TraverseRecursive (UnityEngine.UIElements.VisualElement element, System.Int32 depth) (at <57fa7f4ad1c34ed185465e0a9f71c244>:0)
UnityEngine.UIElements.StyleSheets.HierarchyTraversal.Traverse (UnityEngine.UIElements.VisualElement element) (at <57fa7f4ad1c34ed185465e0a9f71c244>:0)
UnityEngine.UIElements.VisualTreeStyleUpdater.ApplyStyles () (at <57fa7f4ad1c34ed185465e0a9f71c244>:0)
UnityEngine.UIElements.VisualTreeStyleUpdater.Update () (at <57fa7f4ad1c34ed185465e0a9f71c244>:0)
UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at <57fa7f4ad1c34ed185465e0a9f71c244>:0)
UnityEngine.UIElements.Panel.UpdateForRepaint () (at <57fa7f4ad1c34ed185465e0a9f71c244>:0)
UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event e) (at <57fa7f4ad1c34ed185465e0a9f71c244>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <57fa7f4ad1c34ed185465e0a9f71c244>:0)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <57fa7f4ad1c34ed185465e0a9f71c244>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <59837000ebf54955a9cb1d31caa86097>:0)

AdditionalInfo:
- The window class is in com.unity.render-pipelines.core\Editor\LookDev\DisplayWindow.cs
- The Stylesheet is loaded at the top of Window.OnEnable
- Removing the stylesheet loading from OnEnable and putting it in the first call of Window.OnGUI fix the crash but we then have a first frame with wrong layout each time we open the window.
- Having the loading of stylesheet in both OnEnable and first call of OnGUI could work if there is a filtering internal to stylesheet handling to remove garbage collected stylesheets.
- The other error spawned several time is fixed in the former ticket but the fix do not remove the broken window.

Comments (5)

  1. raelyn475

    Sep 06, 2021 06:40

    See the caption as it tells see future courses options and maybe all of you will be able to find more about them and can suggest it to the rest of the community. Soon you all can have HTTPS://topcvwritersuk.com/professional-cv-writing-review/ for us. There are many who are looking for it and will like to share it with the rest as that was good enough.

  2. raelyn475

    Sep 04, 2021 14:52

    good post like it

  3. DejanKulusevski

    Jul 09, 2021 12:38

    While most college undergrads find their studies to be simple, checking through the assignments to make sure they are of high quality can still be a difficult task. To achieve the desired level of forcefulness, students hire professional writers to get the assistance of those who have a proven record of work with academic texts at HTTPS://en.samedayessay.com/. The support from these creators is an unpredictable matter, as the Internet allows both legit authors and scammers to promote their services, and a student won’t differ simply one type of facilitator from another. So, what are your choices?

  4. MonicaBrown

    Mar 17, 2021 18:25

    Thank you for the helpful information. I hope I will find it useful in the future, as you may find what I advise helpful. A week ago I found a great essay writing service. Essaywriterservice review nocramming.com professionals in their business. They got everything done the way I needed it done. If you go to them, they will do everything at the highest level, and you will be happy with their work.

  5. HelenTaylor

    Sep 26, 2020 16:53

    Technology has become an integral part of our daily life and we cannot complete even the basic tasks without modern gadgets. Every device or sytem uses a particular software for its operation and While working on these, one can encounter certain problems which can be very difficult to resolve. To resolve any problem, we need to identify the problem first and this has been made easy at https://issuetracker.unity3d.com/issues/untitled-5 where we can easily find out any bugs or problems.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.