mirror of
https://github.com/BreizhHardware/bloubloulespoissons.git
synced 2026-03-18 21:50:32 +01:00
Fix error
Threads not killed Handle thread kill error
This commit is contained in:
33
main.cpp
33
main.cpp
@@ -302,17 +302,34 @@ int pas_la_fontion_main_enfin_ce_nest_pas_la_fontion_principale_du_programme_mai
|
||||
|
||||
while (running) {
|
||||
renderScene(player, kelps, rocks, corals);
|
||||
handleQuit();
|
||||
SDL_Delay(10);
|
||||
}
|
||||
running = false;
|
||||
player_thread.join();
|
||||
fish_thread.join();
|
||||
/*
|
||||
for (auto& thread : threads) {
|
||||
thread.join();
|
||||
try{
|
||||
if(player_thread.joinable())
|
||||
player_thread.join();
|
||||
}catch(const std::system_error& e){
|
||||
std::cerr << "Exception caught: " << e.what() << std::endl;
|
||||
}
|
||||
try{
|
||||
if(quit_thread.joinable())
|
||||
quit_thread.join();
|
||||
}catch(const std::system_error& e){
|
||||
std::cerr << "Exception caught: " << e.what() << std::endl;
|
||||
}
|
||||
try {
|
||||
if (fish_thread.joinable())
|
||||
fish_thread.join();
|
||||
} catch (const std::system_error& e) {
|
||||
std::cerr << "Exception caught: " << e.what() << std::endl;
|
||||
}
|
||||
try {
|
||||
for (auto& thread : threads) {
|
||||
thread.join();
|
||||
}
|
||||
} catch (const std::system_error& e) {
|
||||
std::cerr << "Exception caught: " << e.what() << std::endl;
|
||||
}
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -393,4 +410,4 @@ void cleanup() {
|
||||
}
|
||||
IMG_Quit();
|
||||
SDL_Quit();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user