Fix for threads not terminating

pull/101/head
Ryzerth 2021-04-21 17:23:09 +02:00
rodzic a0316e57c5
commit 4849d9cf09
1 zmienionych plików z 7 dodań i 2 usunięć

Wyświetl plik

@ -70,6 +70,11 @@ namespace dsp {
Reshaper(stream<T>* in, int keep, int skip) { init(in, keep, skip); }
// NOTE: For some reason, the base class destrcutor doesn't get called.... this is a temporary fix I guess
~Reshaper() {
generic_block<Reshaper<T>>::stop();
}
void init(stream<T>* in, int keep, int skip) {
_in = in;
_keep = keep;
@ -114,7 +119,7 @@ namespace dsp {
stream<T> out;
private:
void doStart() {
void doStart() override {
workThread = std::thread(&Reshaper<T>::loop, this);
bufferWorkerThread = std::thread(&Reshaper<T>::bufferWorker, this);
}
@ -123,7 +128,7 @@ namespace dsp {
while (run() >= 0);
}
void doStop() {
void doStop() override {
_in->stopReader();
ringBuf.stopReader();
out.stopWriter();