[mythtv-commits] [MythTV/mythtv] f9baf0: Crash of backend on delete of program being recorded

kmdewaal noreply at github.com
Thu May 21 19:06:41 UTC 2020

  Branch: refs/heads/fixes/31
  Home:   https://github.com/MythTV/mythtv
  Commit: f9baf09e4397032f1a00d98b5085f912547380b6
  Author: Klaas de Waal <kdewaal at 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 at mythtv.org>

More information about the mythtv-commits mailing list