Cocoa: QNSView - fix memory leak of QContainerLayer
setLayer will increment the reference count, so QContainerLayer is leaked, as it is not autoreleased. Pick-to: 6.10 Change-Id: I43cef8bbf9ccb9b849322edfb1e7ab75f5ae9898 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
c8ebe2e5cd
commit
e6dfd2e9b0
@ -142,7 +142,7 @@
|
|||||||
static const bool containerLayerOptOut = qEnvironmentVariableIsSet("QT_MAC_NO_CONTAINER_LAYER");
|
static const bool containerLayerOptOut = qEnvironmentVariableIsSet("QT_MAC_NO_CONTAINER_LAYER");
|
||||||
if (m_platformWindow->window()->surfaceType() != QSurface::OpenGLSurface && !containerLayerOptOut) {
|
if (m_platformWindow->window()->surfaceType() != QSurface::OpenGLSurface && !containerLayerOptOut) {
|
||||||
qCDebug(lcQpaDrawing) << "Wrapping content layer" << layer << "in container layer";
|
qCDebug(lcQpaDrawing) << "Wrapping content layer" << layer << "in container layer";
|
||||||
auto *containerLayer = [[QContainerLayer alloc] initWithContentLayer:layer];
|
auto *containerLayer = [[[QContainerLayer alloc] initWithContentLayer:layer] autorelease];
|
||||||
containerLayer.name = @"Qt container layer";
|
containerLayer.name = @"Qt container layer";
|
||||||
containerLayer.delegate = self;
|
containerLayer.delegate = self;
|
||||||
layer = containerLayer;
|
layer = containerLayer;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user