diff options
author | Alberto Compagno <acompagn+fdio@cisco.com> | 2019-02-13 15:06:23 +0100 |
---|---|---|
committer | Alberto Compagno <acompagn+fdio@cisco.com> | 2019-02-13 15:06:23 +0100 |
commit | d1dedcb21e7ba074a0a83fad09a742e54a8d1525 (patch) | |
tree | 31aebff80bf016d32480a1e38b3e58110f8adb67 /libtransport/src/hicn/transport/utils/object_pool.h | |
parent | 13fccc2bb1c2317061e6bf985c87bca647fb3b6f (diff) |
[HICN-60] Solved concurrent memory access which was leading to seg-fault
Change-Id: I7b9fcf79bb97650346f7d92af8cbb419f0a5cb95
Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
Diffstat (limited to 'libtransport/src/hicn/transport/utils/object_pool.h')
-rw-r--r-- | libtransport/src/hicn/transport/utils/object_pool.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libtransport/src/hicn/transport/utils/object_pool.h b/libtransport/src/hicn/transport/utils/object_pool.h index 9fda214cd..e34730e81 100644 --- a/libtransport/src/hicn/transport/utils/object_pool.h +++ b/libtransport/src/hicn/transport/utils/object_pool.h @@ -62,6 +62,7 @@ class ObjectPool { void add(T *object) { utils::SpinLock::Acquire locked(object_pool_lock_); + if (TRANSPORT_EXPECT_TRUE(!destructor_)) { object_pool_.emplace_back(makePtr(object)); } |