Skip to content

Commit

Permalink
Fix a PreviewGenerator dtor race.
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-kristjansson committed Mar 12, 2012
1 parent 0542a10 commit ff73126
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 0 additions & 2 deletions mythtv/libs/libmythtv/previewgenerator.cpp
Expand Up @@ -327,8 +327,6 @@ void PreviewGenerator::run(void)
{
RunProlog();
Run();
connect(qthread(), SIGNAL(finished()),
this, SLOT(deleteLater()));
RunEpilog();
}

Expand Down
10 changes: 7 additions & 3 deletions mythtv/libs/libmythtv/previewgeneratorqueue.cpp
Expand Up @@ -167,6 +167,7 @@ bool PreviewGeneratorQueue::event(QEvent *e)
return true;
}

(*it).gen->deleteLater();
(*it).gen = NULL;
(*it).genStarted = false;
if (me->Message() == "PREVIEW_SUCCESS")
Expand Down Expand Up @@ -473,9 +474,12 @@ void PreviewGeneratorQueue::SetPreviewGenerator(
PreviewGenState &state = m_previewMap[key];
if (state.gen)
{
if (!g->GetToken().isEmpty())
state.tokens.insert(g->GetToken());
g->deleteLater();
if (state.gen != g)
{
if (!g->GetToken().isEmpty())
state.tokens.insert(g->GetToken());
g->deleteLater();
}
}
else
{
Expand Down

0 comments on commit ff73126

Please sign in to comment.