Skip to content

Commit 0931169

Browse files
committed
Don't use WWrapPointer if has monitor aboutToBeInvalidated
1 parent e82679a commit 0931169

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/server/qtquick/private/wsurfaceitem_p.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class Q_DECL_HIDDEN WSurfaceItemPrivate : public QQuickItemPrivate
6464
}
6565

6666
Q_DECLARE_PUBLIC(WSurfaceItem)
67-
WWrapPointer<WSurface> surface;
67+
WSurface *surface = nullptr;
6868
WWrapPointer<WToplevelSurface> shellSurface;
6969
std::unique_ptr<SurfaceState> surfaceState;
7070
QQuickItem *contentContainer = nullptr;

src/server/qtquick/wsurfaceitem.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ class Q_DECL_HIDDEN WSurfaceItemContentPrivate: public QQuickItemPrivate
271271
}
272272

273273
W_DECLARE_PUBLIC(WSurfaceItemContent)
274-
WWrapPointer<WSurface> surface;
274+
WSurface *surface = nullptr;
275275
QRectF bufferSourceBox;
276276
QPoint bufferOffset;
277277
qreal devicePixelRatio = 1.0;
@@ -900,6 +900,7 @@ void WSurfaceItem::releaseResources()
900900

901901
if (d->surface) {
902902
d->surface->safeDisconnect(this);
903+
d->surface = nullptr;
903904
}
904905

905906
if (!d->surfaceFlags.testFlag(DontCacheLastBuffer)) {

0 commit comments

Comments
 (0)