2
0
mirror of https://github.com/boostorg/fiber.git synced 2026-02-15 00:52:34 +00:00

make a local copy of allocator in destroy_()

This commit is contained in:
Oliver Kowalke
2015-12-18 18:26:52 +01:00
parent 8c80a4510c
commit 3a2e68b4b5
2 changed files with 12 additions and 9 deletions

View File

@@ -41,9 +41,10 @@ protected:
private:
allocator_t alloc_;
static void destroy_( allocator_t & alloc, shared_state_object * p) noexcept {
alloc.destroy( p);
alloc.deallocate( p, 1);
static void destroy_( allocator_t const& alloc, shared_state_object * p) noexcept {
allocator_t a{ alloc };
a.destroy( p);
a.deallocate( p, 1);
}
};

View File

@@ -79,9 +79,10 @@ private:
Fn fn_;
allocator_t alloc_;
static void destroy_( allocator_t & alloc, task_object * p) noexcept {
alloc.destroy( p);
alloc.deallocate( p, 1);
static void destroy_( allocator_t const& alloc, task_object * p) noexcept {
allocator_t a{ alloc };
a.destroy( p);
a.deallocate( p, 1);
}
};
@@ -139,9 +140,10 @@ private:
Fn fn_;
allocator_t alloc_;
static void destroy_( allocator_t & alloc, task_object * p) noexcept {
alloc.destroy( p);
alloc.deallocate( p, 1);
static void destroy_( allocator_t const& alloc, task_object * p) noexcept {
allocator_t a{ alloc };
a.destroy( p);
a.deallocate( p, 1);
}
};