Skip to content

Commit 5893986

Browse files
committed
iox-#33 NamedPipeData is only destroyed when NamedPipe has the ownership
Signed-off-by: Christian Eltzschig <[email protected]>
1 parent c0a2272 commit 5893986

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

iceoryx_hoofs/source/posix_wrapper/named_pipe.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,10 @@ cxx::expected<IpcChannelError> NamedPipe::destroy() noexcept
163163
{
164164
m_isInitialized = false;
165165
m_errorValue = IpcChannelError::NOT_INITIALIZED;
166-
m_data->~NamedPipeData();
166+
if (m_sharedMemory->hasOwnership())
167+
{
168+
m_data->~NamedPipeData();
169+
}
167170
m_sharedMemory.reset();
168171
m_data = nullptr;
169172
}

0 commit comments

Comments
 (0)