Fix #127, threads should not be cancelled after being joined

This commit is contained in:
jacksonmj 2013-07-06 21:26:52 +01:00
parent 74b8b2c85b
commit 1b58c1eea8

View File

@ -347,9 +347,21 @@ void PreviewModel::Update()
} }
PreviewModel::~PreviewModel() { PreviewModel::~PreviewModel() {
pthread_cancel(updateSaveDataThread); if (updateSaveDataWorking)
pthread_cancel(updateSaveInfoThread); {
pthread_cancel(updateSaveCommentsThread); pthread_cancel(updateSaveDataThread);
pthread_join(updateSaveDataThread, NULL);
}
if (updateSaveInfoWorking)
{
pthread_cancel(updateSaveInfoThread);
pthread_join(updateSaveInfoThread, NULL);
}
if (updateSaveCommentsWorking)
{
pthread_cancel(updateSaveCommentsThread);
pthread_join(updateSaveCommentsThread, NULL);
}
if(save) if(save)
delete save; delete save;
if(saveComments) if(saveComments)