[mythtv-commits] Ticket #13571: Crash of backend on delete of program being recorded

MythTV noreply at mythtv.org
Sat May 16 20:46:00 UTC 2020


#13571: Crash of backend on delete of program being recorded
--------------------------------+-------------------------------
 Reporter:  Klaas de Waal       |          Owner:  Klaas de Waal
     Type:  Bug Report - Crash  |         Status:  new
 Priority:  minor               |      Milestone:  32.0
Component:  MythTV - General    |        Version:  Master Head
 Severity:  medium              |     Resolution:
 Keywords:                      |  Ticket locked:  0
--------------------------------+-------------------------------

Comment (by Klaas de Waal):

 Added patch 20200516-encoderlink-rc2.patch which is intended to be the
 final patch for this problem. This patch can be applied to today's master.
 This patch is largely identical to the patch 20200513-encoderlink-make-
 const.patch.

 Although replacing the foreach loop with for loop does already fix the
 problem it is a good idea to make container access explicitly readonly by
 using qAsConst.

 N.B. The Qt function qAsConst is used instead of the C++ std::as_const
 because the std::as_const is introduced in C++17 and the fix should also
 be applied to v31 which is C++11 based.

 If final testing does not show any problems and if no further suggestions
 for improvements are received then the intention is to put this in master,
 and a few weeks later in v31-fixes.

 This patch replaces a number of foreach statements introduced in commit
 16bd3ad9849bd393c69571d0d0f967062fd32b78 on 29 Dec 2019 with the goal of
 modernizing control loops. However, contrary to what is described in the
 commit message, the foreach does actually cause the problems that the C++
 iterators do not, instead of the other way around.

 It might be a good idea to revisit all places in the code where foreach
 has recently been introduced to check if there are more possible problems
 and revert the modernizations done. However, that is clearly out of scope
 for this ticket.

 N.B. There are 646 occurrences of the keyword foreach by last count.

 N.B. More interesting reading, dated 2016: https://www.kdab.com/goodbye-
 q_foreach/

-- 
Ticket URL: <https://code.mythtv.org/trac/ticket/13571#comment:34>
MythTV <http://www.mythtv.org>
MythTV Media Center


More information about the mythtv-commits mailing list