Uploaded image for project: 'MediaPortal 2'
  1. MediaPortal 2
  2. MP2-919

VirtualizingPanels can get stuck in an infinite loop if the ItemsProvider is updated whilst the panel is preparing

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.5
    • 2.4.1
    • Skin Engine
    • None

    Description

      When an ItemsControl sets a VirtualizingPanel's ItemProvider and the panel is still in the preparing state, the old ItemProvider is disposed without locking, e.g. here https://github.com/MediaPortal/MediaPortal-2/blob/1145c74af454a8e003f6a5f43f69126c435b94e7/MediaPortal/Source/UI/SkinEngine/Controls/Panels/VirtualizingStackPanel.cs#L129-L138

      This can lead to the VirtualizingPanel attempting to retrieve items from the old disposed provider when it does it's initial arrange. The old provider then returns null items and due to a bug this causes the panel to get stuck in an infinite loop due to it continually requesting the same null item e.g. here - https://github.com/MediaPortal/MediaPortal-2/blob/1145c74af454a8e003f6a5f43f69126c435b94e7/MediaPortal/Source/UI/SkinEngine/Controls/Panels/VirtualizingStackPanel.cs#L507-L508

      There are two parts that need resolving:
      Ideally the panel should not be using the disposed provider, so the panel should always lock when updating the provider regardless of whether it's in the preparing state. Secondly, the loop should exit cleanly if an item provider returns a null or not visible item.

      Attachments

        Activity

          People

            brownard Brownard
            brownard Brownard
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: