[Libreoffice-commits] core.git: sal/qa
Caolán McNamara
caolanm at redhat.com
Mon Jul 24 11:23:32 UTC 2017
sal/qa/osl/pipe/osl_Pipe.cxx | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
New commits:
commit a43187d9075c6347412a2584d764145127779df8
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Jul 24 12:16:35 2017 +0100
fix use after delete in osl::Pipe dtor
drop down the the c api so we can truly pass ownership of the handle to
xNoAcquirePipe
Change-Id: I12acbec81726ae4a451b501bea5492a5865c0cc4
diff --git a/sal/qa/osl/pipe/osl_Pipe.cxx b/sal/qa/osl/pipe/osl_Pipe.cxx
index a2f20058b36e..8fd43226f0db 100644
--- a/sal/qa/osl/pipe/osl_Pipe.cxx
+++ b/sal/qa/osl/pipe/osl_Pipe.cxx
@@ -172,11 +172,12 @@ namespace osl_Pipe
void ctors_no_acquire( )
{
/// create a pipe.
- std::unique_ptr<osl::Pipe> xPipe(new osl::Pipe(test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE));
+ OUString aPipeName(test::uniquePipeName(aTestPipeName));
+ oslPipe handle(osl_createPipe(aPipeName.pData, osl_Pipe_CREATE, nullptr));
/// constructs a pipe reference without acquiring the handle.
- std::unique_ptr<osl::Pipe> xNoAcquirePipe(new osl::Pipe(xPipe->getHandle(), SAL_NO_ACQUIRE));
+ std::unique_ptr<osl::Pipe> xNoAcquirePipe(new osl::Pipe(handle, SAL_NO_ACQUIRE));
- StreamPipe aStreamPipe(xPipe->getHandle());
+ StreamPipe aStreamPipe(handle);
xNoAcquirePipe.reset();
int nRet = aStreamPipe.send("a", 1);
More information about the Libreoffice-commits
mailing list