summaryrefslogtreecommitdiffstats
path: root/src/plugins/multimedia/ffmpeg/qavfcamera.mm
diff options
context:
space:
mode:
authorArtem Dyomin <artem.dyomin@qt.io>2022-11-25 15:09:14 +0100
committerArtem Dyomin <artem.dyomin@qt.io>2022-11-29 09:49:51 +0000
commitd73cc0bce893b81de3f84c570110c8969b9ee468 (patch)
tree592ab5b36c78698062ca845cf3e206b1c8cc97b9 /src/plugins/multimedia/ffmpeg/qavfcamera.mm
parent5a0b6bee16c9b71589209e6aa18a77c987d27800 (diff)
Fix ffmpeg camera crash on macOS (double releasing of an object)
The reason for the crash is 'autorelease' and 'release' in the destructor. In applications, QMacAutoReleasePool releases it 2nd time. The application crashed after a few camera changes. So we should use only one approach. The suggestion is to manage the object manually for both backends in order to make the behavior more predictable. The added test checks the case. Pick-to: 6.4 Change-Id: I80a644acd94ae469a16fd95ba971441c78e7a700 Reviewed-by: Doris Verria <doris.verria@qt.io>
Diffstat (limited to 'src/plugins/multimedia/ffmpeg/qavfcamera.mm')
-rw-r--r--src/plugins/multimedia/ffmpeg/qavfcamera.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/multimedia/ffmpeg/qavfcamera.mm b/src/plugins/multimedia/ffmpeg/qavfcamera.mm
index cb7cfdaec..d6ec94a0e 100644
--- a/src/plugins/multimedia/ffmpeg/qavfcamera.mm
+++ b/src/plugins/multimedia/ffmpeg/qavfcamera.mm
@@ -220,7 +220,7 @@ void QAVFCamera::updateVideoInput()
attachVideoInputDevice();
if (!m_videoDataOutput) {
- m_videoDataOutput = [[[AVCaptureVideoDataOutput alloc] init] autorelease];
+ m_videoDataOutput = [[AVCaptureVideoDataOutput alloc] init];
// Configure video output
m_delegateQueue = dispatch_queue_create("vf_queue", nullptr);