Mailing List Archive

[MythTV/mythtv] f9baf0: Crash of backend on delete of program being recorded
Branch: refs/heads/fixes/31
Home: https://github.com/MythTV/mythtv
Commit: f9baf09e4397032f1a00d98b5085f912547380b6
https://github.com/MythTV/mythtv/commit/f9baf09e4397032f1a00d98b5085f912547380b6
Author: Klaas de Waal <kdewaal@mythtv.org>
Date: 2020-05-21 (Thu, 21 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

(cherry picked from commit 8e2872679315547abc3c2f1a91e0f7b8baac79dc)
Signed-off-by: Klaas de Waal <kdewaal@mythtv.org>


_______________________________________________
mythtv-commits mailing list
mythtv-commits@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-commits