also not sure about calling close on destruction, i think you usually want to have full control over the thread shutdown if you leave it to RAII it's can be problematic if you aren't very careful, for example some members in the class might have been already destroyed when the channel is closed and the thread might try to access them so it's better to explicitly close the channel and wait for the thread on the destructor of your class
also not sure about calling close on destruction, i think you usually want to have full control over the thread shutdown if you leave it to RAII it's can be problematic if you aren't very careful, for example some members in the class might have been already destroyed when the channel is closed and the thread might try to access them so it's better to explicitly close the channel and wait for the thread on the destructor of your class
Originally posted by @arturoc in https://github.com/openframeworks/openFrameworks/issues/4809#issuecomment-182784008