I create a new std::thread object, and then detach() it. The thread runs for an arbitrary amount of time, and then terminates itself. Since I created the object with new, do I need to delete it at some point to free up its resources? Or does the thread effectively delete itself upon termination?
If it does effectively delete itself, will something bad happen if I explicitly delete it after it has terminated?
Aucun commentaire:
Enregistrer un commentaire