Skip to content

Commit

Permalink
Fix a bunch of memory leaks in mythmetadatalookup. Coverity.
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartm committed May 18, 2012
1 parent c85ed06 commit 95e6182
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions mythtv/programs/mythmetadatalookup/lookup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ LookerUpper::LookerUpper() :

LookerUpper::~LookerUpper()
{
while (!m_busyRecList.isEmpty())
delete m_busyRecList.takeFirst();
}

bool LookerUpper::StillWorking()
Expand Down Expand Up @@ -82,6 +84,8 @@ void LookerUpper::HandleAllRecordings(bool updaterules)
m_busyRecList.append(pginfo);
m_metadataFactory->Lookup(pginfo, false, false, false);
}
else
delete pginfo;
}
}

Expand All @@ -105,6 +109,8 @@ void LookerUpper::HandleAllRecordingRules()
m_busyRecList.append(pginfo);
m_metadataFactory->Lookup(pginfo, false, false, true);
}
else
delete pginfo;
}
}

Expand Down Expand Up @@ -140,8 +146,10 @@ void LookerUpper::HandleAllArtwork(bool aggressive)

m_busyRecList.append(pginfo);
m_metadataFactory->Lookup(pginfo, false, true, true);
continue;
}
}
delete pginfo;
}

// Now, Attempt to fill in the gaps for recordings
Expand Down Expand Up @@ -180,8 +188,10 @@ void LookerUpper::HandleAllArtwork(bool aggressive)

m_busyRecList.append(pginfo);
m_metadataFactory->Lookup(pginfo, false, true, aggressive);
continue;
}
}
delete pginfo;
}

}
Expand Down Expand Up @@ -212,10 +222,10 @@ void LookerUpper::CopyRuleInetrefsToRecordings()
msg += " has no inetref, but its recording rule does. Copying...";
LOG(VB_GENERAL, LOG_INFO, msg);
pginfo->SaveInetRef(rule->m_inetref);
delete rule;
}
delete pginfo;
delete rule;
}
delete pginfo;
}
}

Expand Down

0 comments on commit 95e6182

Please sign in to comment.