fix block_queue pop and clear methods

- pop was bzero'ing the popped object which
  causes for more complex objects like std::string
- clear wasn't actually emptying the queue
This commit is contained in:
Andre Puschmann 2018-10-03 10:29:56 +02:00
parent c56fa3b46c
commit bd6bb6903f
1 changed files with 1 additions and 2 deletions

View File

@ -109,7 +109,6 @@ public:
myobj wait_pop() { // blocking pop
myobj value;
bzero(&value, sizeof(myobj));
pop_(&value, true);
return value;
}
@ -154,8 +153,8 @@ private:
}
if (value) {
*value = q.front();
q.pop();
}
q.pop();
ret = true;
if (mutexed_callback) {
mutexed_callback->popping(*value);