diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-10-03 16:55:39 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-10-04 20:27:29 +0000 |
commit | 5b4cf7af6a492b6ef5b7c718b346b38ddad4c990 (patch) | |
tree | 77b1664ff66bcde909260db46a4cc22f6681ce60 /mkspecs/linux-g++ | |
parent | 1b473ee676d5e99437b84dfe76e1d952e5a73428 (diff) |
macOS: Prevent backingstore image detach during color space assignmentv5.10.0-beta1
The call to CGImageCreateCopyWithColorSpace took a naked toCGImage(),
which left the resulting CGImageRef without a release, causing the
extra ref by toCGImage() to never be derefed, and a subsequent detach
of the image data on the next paint event.
Wrapping the call in a QCFType<CGImageRef> solves the problem. The code
has also been moved directly into QCocoaBackingStore::flush(), as there
is no need to keep the CGImageRef a member.
A local autorelease pool has been added to QCocoaBackingStore::flush(),
so that the NSImage used for blitting the backingstore is released upon
exit of the function, thereby releasing the corresponding CGImageRef.
Note that for layered mode, the QImage will still detach, as the view's
layer.contents property keeps a reference to the image data until being
replaced in a subsequent flush.
Task-number: QTBUG-63559
Change-Id: I06b9298f65a84deae7cc2eff617ba75c92ec3b87
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'mkspecs/linux-g++')
0 files changed, 0 insertions, 0 deletions