effects/private: Fix crash when shutting down desktop grid and overview
Because of const/non-const issues, iterator got invalidated in the loop, which led to a crash. Cases that trigger it: interaction with a thumbnail while the effect is returning to initial state and shuts down. For example, slightly dragging and releasing a thumbnail such that both TapHandler & DragHandler would react and play each their own transition (yes, it's another bug); or by pressing Escape key while dragging.
This commit is contained in:
parent
9897afa55f
commit
d3a5a72a46
1 changed files with 3 additions and 3 deletions
|
@ -23,7 +23,7 @@ public:
|
|||
{
|
||||
return effect->d.get();
|
||||
}
|
||||
bool isItemOnScreen(QQuickItem *item, EffectScreen *screen);
|
||||
bool isItemOnScreen(QQuickItem *item, EffectScreen *screen) const;
|
||||
|
||||
SharedQmlEngine::Ptr qmlEngine;
|
||||
std::unique_ptr<QQmlComponent> qmlComponent;
|
||||
|
@ -34,13 +34,13 @@ public:
|
|||
std::unique_ptr<QWindow> dummyWindow;
|
||||
};
|
||||
|
||||
bool QuickSceneEffectPrivate::isItemOnScreen(QQuickItem *item, EffectScreen *screen)
|
||||
bool QuickSceneEffectPrivate::isItemOnScreen(QQuickItem *item, EffectScreen *screen) const
|
||||
{
|
||||
if (!item || !screen || !views.contains(screen)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto *view = views[screen];
|
||||
const QuickSceneView *view = views[screen];
|
||||
auto *rootItem = view->rootItem();
|
||||
auto candidate = item->parentItem();
|
||||
// Is there a more efficient way?
|
||||
|
|
Loading…
Reference in a new issue