Ticket #6536: mythweather_fix.4.patch

File mythweather_fix.4.patch, 3.2 KB (added by Marc Alban <marcalban@…>, 16 years ago)

An updated patch to fix both segfaults.

  • mythplugins/mythweather/mythweather/weather.cpp

     
    304304{
    305305    m_srcMan->stopTimers();
    306306    m_nextpage_Timer->stop();
    307     m_srcMan->clearSources();
    308     m_srcMan->findScripts();
    309307
    310308    MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
    311309
  • mythplugins/mythweather/mythweather/weatherSetup.cpp

     
    598598
    599599        if (resultid == "options")
    600600        {
    601             MythUIButtonListItem *item = qVariantValue<MythUIButtonListItem *>(dce->GetData());
    602             ScreenListInfo *si = qVariantValue<ScreenListInfo *>(item->GetData());
     601            if (buttonnum > -1)
     602            {
     603                MythUIButtonListItem *item = qVariantValue<MythUIButtonListItem *>(dce->GetData());
     604                                       
     605                ScreenListInfo *si = qVariantValue<ScreenListInfo *>(item->GetData());
    603606
    604             if (buttonnum == 0)
    605             {
    606                 m_activeList->MoveItemUpDown(item, true);
     607                if (buttonnum == 0)
     608                {
     609                    m_activeList->MoveItemUpDown(item, true);
     610                }
     611                else if (buttonnum == 1)
     612                {
     613                    m_activeList->MoveItemUpDown(item, false);
     614                }
     615                else if (buttonnum == 2)
     616                {
     617                    deleteScreen();
     618                }
     619                else if (buttonnum == 3)
     620                {
     621                    doLocationDialog(si);
     622                }
     623                else if (si->hasUnits && buttonnum == 4)
     624                {
     625                    showUnitsPopup(item->GetText(), si);
     626                    updateHelpText();
     627                }
    607628            }
    608             else if (buttonnum == 1)
    609             {
    610                 m_activeList->MoveItemUpDown(item, false);
    611             }
    612             else if (buttonnum == 2)
    613             {
    614                 deleteScreen();
    615             }
    616             else if (buttonnum == 3)
    617             {
    618                 doLocationDialog(si);
    619             }
    620             else if (si->hasUnits && buttonnum == 4)
    621             {
    622                 showUnitsPopup(item->GetText(), si);
    623                 updateHelpText();
    624             }
    625629        }
    626630        else if (resultid == "units")
    627631        {
  • mythplugins/mythweather/mythweather/main.cpp

     
    6767{
    6868    MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
    6969
     70    if (!srcMan)
     71    {
     72        srcMan = new SourceManager();
     73        srcMan->startTimers();
     74        srcMan->doUpdate();
     75    }
    7076    Weather *weather = new Weather(mainStack, "mythweather", srcMan);
    7177
    7278    if (weather->Create())