Ticket #5691: programs_mythbackend-uninit.patch

File programs_mythbackend-uninit.patch, 2.2 KB (added by Erik Hovland <erik@…>, 11 years ago)

init meber vars in ctors and use class scoping

  • mythtv/programs/mythbackend/autoexpire.cpp

    Defects where a variable might not be initialized.
    
    From: Erik Hovland <erik@hovland.org>
    
    
    ---
    
     mythtv/programs/mythbackend/autoexpire.cpp |    5 +++--
     mythtv/programs/mythbackend/mainserver.cpp |    3 ++-
     mythtv/programs/mythbackend/scheduler.cpp  |    4 ++--
     3 files changed, 7 insertions(+), 5 deletions(-)
    
    diff --git a/mythtv/programs/mythbackend/autoexpire.cpp b/mythtv/programs/mythbackend/autoexpire.cpp
    index ab0eb49..13906f3 100644
    a b AutoExpire::AutoExpire(QMap<int, EncoderLink *> *tvList) 
    6767 *  \brief Creates AutoExpire class
    6868 */
    6969AutoExpire::AutoExpire(void)
     70    : encoderList(NULL),
     71      expire_thread(pthread_t()), expire_thread_running(false),
     72      update_thread(pthread_t())
    7073{
    71     encoderList = NULL;
    72     expire_thread_running = false;
    7374    Init();
    7475}
    7576
  • mythtv/programs/mythbackend/mainserver.cpp

    diff --git a/mythtv/programs/mythbackend/mainserver.cpp b/mythtv/programs/mythbackend/mainserver.cpp
    index 6012fb6..69a8b39 100644
    a b QMutex MainServer::truncate_and_close_lock; 
    109109class ProcessRequestThread : public QThread
    110110{
    111111  public:
    112     ProcessRequestThread(MainServer *ms) { parent = ms; }
     112    ProcessRequestThread(MainServer *ms)
     113        : parent(ms), socket(0), threadlives(false) { parent = ms; }
    113114
    114115    void setup(MythSocket *sock)
    115116    {
  • mythtv/programs/mythbackend/scheduler.cpp

    diff --git a/mythtv/programs/mythbackend/scheduler.cpp b/mythtv/programs/mythbackend/scheduler.cpp
    index dd42416..5233f0b 100644
    a b void Scheduler::SchedPreserveLiveTV(void) 
    36913691        // Get the program that will be recording on this channel
    36923692        // at record start time, if this LiveTV session continues.
    36933693        ProgramInfo *dummy =
    3694             dummy->GetProgramAtDateTime(QString::number(in.chanid),
    3695                                         livetvTime, true, 4);
     3694            ProgramInfo::GetProgramAtDateTime(QString::number(in.chanid),
     3695                                              livetvTime, true, 4);
    36963696        if (!dummy)
    36973697            continue;
    36983698