mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-28 02:09:59 +02:00
Fix #127, threads should not be cancelled after being joined
This commit is contained in:
@@ -347,9 +347,21 @@ void PreviewModel::Update()
|
||||
}
|
||||
|
||||
PreviewModel::~PreviewModel() {
|
||||
pthread_cancel(updateSaveDataThread);
|
||||
pthread_cancel(updateSaveInfoThread);
|
||||
pthread_cancel(updateSaveCommentsThread);
|
||||
if (updateSaveDataWorking)
|
||||
{
|
||||
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)
|
||||
delete save;
|
||||
if(saveComments)
|
||||
|
Reference in New Issue
Block a user