Search Unity

uGui 4.6.0.21b: The object of type 'Image' has been destroyed but you are still trying to access it

Discussion in 'UGUI & TextMesh Pro' started by Togis, Oct 31, 2014.

  1. Togis

    Togis

    Joined:
    Aug 24, 2014
    Posts:
    4
    Hello everyone,

    My computer died 2 days ago. I was working on a huge UI prototype in the new UI in the first beta (4.6. 17 or 18 top)

    I had to make a clean install and used the 4.6.0.21b version (the 20b didn't crashed on loading my scene, use of prefab)

    After adapting all my use of Layout Group, I only have one issue left.

    I have many panel in an unique screen canvas, for many interfaces, and I switch from one to the other with gameobject.setActive(bool)

    Everything works fine until I need to refresh some UI with new values. Unity throw many of this error per frame and doesn't stop:

    Code (CSharp):
    1. MissingReferenceException: The object of type 'Image' has been destroyed but you are still trying to access it.
    2. Your script should either check if it is null or you should not destroy the object.
    3. UnityEngine.Component.GetComponent[CanvasRenderer] () (at C:/BuildAgent/work/d63dfc6385190b60/artifacts/EditorGenerated/UnityEngineComponent.cs:189)
    4. UnityEngine.UI.Graphic.get_canvasRenderer () (at C:/BuildAgent/work/d63dfc6385190b60/Extensions/guisystem/guisystem/UI/Core/Graphic.cs:184)
    5. UnityEngine.UI.Graphic.get_depth () (at C:/BuildAgent/work/d63dfc6385190b60/Extensions/guisystem/guisystem/UI/Core/Graphic.cs:145)
    6. UnityEngine.UI.GraphicRaycaster.Raycast (UnityEngine.Canvas canvas, UnityEngine.Camera eventCamera, Vector2 pointerPosition, System.Collections.Generic.List`1 results) (at C:/BuildAgent/work/d63dfc6385190b60/Extensions/guisystem/guisystem/UI/Core/GraphicRaycaster.cs:181)
    7. UnityEngine.UI.GraphicRaycaster.Raycast (UnityEngine.EventSystems.PointerEventData eventData, System.Collections.Generic.List`1 resultAppendList) (at C:/BuildAgent/work/d63dfc6385190b60/Extensions/guisystem/guisystem/UI/Core/GraphicRaycaster.cs:104)
    8. UnityEngine.EventSystems.EventSystem.RaycastAll (UnityEngine.EventSystems.PointerEventData eventData, System.Collections.Generic.List`1 raycastResults) (at C:/BuildAgent/work/d63dfc6385190b60/Extensions/guisystem/guisystem/EventSystem/EventSystem.cs:147)
    9. UnityEngine.EventSystems.PointerInputModule.GetMousePointerEventData () (at C:/BuildAgent/work/d63dfc6385190b60/Extensions/guisystem/guisystem/EventSystem/InputModules/PointerInputModule.cs:143)
    10. UnityEngine.EventSystems.StandaloneInputModule.ProcessMouseEvent () (at C:/BuildAgent/work/d63dfc6385190b60/Extensions/guisystem/guisystem/EventSystem/InputModules/StandaloneInputModule.cs:276)
    11. UnityEngine.EventSystems.StandaloneInputModule.Process () (at C:/BuildAgent/work/d63dfc6385190b60/Extensions/guisystem/guisystem/EventSystem/InputModules/StandaloneInputModule.cs:159)
    12. UnityEngine.EventSystems.EventSystem.Update () (at C:/BuildAgent/work/d63dfc6385190b60/Extensions/guisystem/guisystem/EventSystem/EventSystem.cs:241)
    13.  
    Would you have any idea of what could be the cause?

    All use of any image in my scripts are surrounded by null reference check.
     
  2. Togis

    Togis

    Joined:
    Aug 24, 2014
    Posts:
    4