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
master
Andre Puschmann 6 years ago
parent c56fa3b46c
commit bd6bb6903f

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

Loading…
Cancel
Save