diff options
author | Chris Robinson <[email protected]> | 2023-05-24 11:56:56 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-05-24 11:56:56 -0700 |
commit | f3e9d066df50a6e77e8c15ea97b195a4b069f254 (patch) | |
tree | 1823b869dd881b1c46243ba3e653979d210caba6 /core/context.cpp | |
parent | da56dd074595d6590273eeb1739f1c9bfc1b5fee (diff) |
Be a bit more safe with type mangling
Diffstat (limited to 'core/context.cpp')
-rw-r--r-- | core/context.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/context.cpp b/core/context.cpp index 145ce349..2ebbc7b1 100644 --- a/core/context.cpp +++ b/core/context.cpp @@ -66,12 +66,14 @@ ContextBase::~ContextBase() auto evt_vec = mAsyncEvents->getReadVector(); if(evt_vec.first.len > 0) { - std::destroy_n(reinterpret_cast<AsyncEvent*>(evt_vec.first.buf), evt_vec.first.len); + std::destroy_n(std::launder(reinterpret_cast<AsyncEvent*>(evt_vec.first.buf)), + evt_vec.first.len); count += evt_vec.first.len; } if(evt_vec.second.len > 0) { - std::destroy_n(reinterpret_cast<AsyncEvent*>(evt_vec.second.buf), evt_vec.second.len); + std::destroy_n(std::launder(reinterpret_cast<AsyncEvent*>(evt_vec.second.buf)), + evt_vec.second.len); count += evt_vec.second.len; } if(count > 0) |