From bd6bb6903f12be47eb89a9669e64084f2b4743f8 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Wed, 3 Oct 2018 10:29:56 +0200 Subject: [PATCH] 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 --- lib/include/srslte/common/block_queue.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/include/srslte/common/block_queue.h b/lib/include/srslte/common/block_queue.h index 2e476dd65..1098e3db5 100644 --- a/lib/include/srslte/common/block_queue.h +++ b/lib/include/srslte/common/block_queue.h @@ -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);