Mailing List Archive

[MythTV/mythtv] 8e2872: Crash of backend on delete of program being recorded
Branch: refs/heads/master
Commit: 8e2872679315547abc3c2f1a91e0f7b8baac79dc
Author: Klaas de Waal <>
Date: 2020-05-17 (Sun, 17 May 2020)

Changed paths:
M mythtv/programs/mythbackend/httpstatus.cpp
M mythtv/programs/mythbackend/mainserver.cpp
M mythtv/programs/mythbackend/scheduler.cpp
M mythtv/programs/mythbackend/services/dvr.cpp

Log Message:
Crash of backend on delete of program being recorded

Fix this crash and similar backend crashes in the scheduler
by replacing all iterations over m_tvList/m_encoderLink/m_pEncoders
from using the Qt extension foreach to the C++11 range-based for loop.
The foreach apparently makes a deep copy of the container thereby
invalidating the iterators that may be active on the same container
simultaneously in a different thread.
As an additional safeguard the qAsConst, a Qt-specific variant
of std:as_const, is added to all loops.

Fixes #13571

mythtv-commits mailing list