• Toni Barzic's avatar
    Reset item containers when holding space bubble is reset · 222b370e
    Toni Barzic authored
    Holding space item views depend on HoldingSpaceItemViewDelegate owned by
    the HoldingSpaceTray. The delegate is reset with HoldingSpaceTrayBubble
    when the bubble is closed, which happens before the bubble widget gets
    torn down. Given that widget is destroyed asynchronously, there's a
    short time interval where holding space item container views are still
    around, but the delegate they depend on is destroyed - if a new item
    gets added at this time, it would cause usage of deleted delegate.
    (Found by tests added in CL:2493323).
    
    To prevent this, remove container views from holding space controller
    model and controller immediately when the HoldingSpaceTrayBubble gets
    reset.
    
    Change-Id: Icf5c523027ad352adff11ce9856a82bd93a7e4c5
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2503628Reviewed-by: default avatarDavid Black <dmblack@google.com>
    Commit-Queue: Toni Baržić <tbarzic@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#821361}
    222b370e
holding_space_tray_bubble.cc 7.51 KB