diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-05-11 15:03:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-05-11 17:28:43 +0200 |
commit | da6c8343993c4d5c0e7b60eebe27a611def7f250 (patch) | |
tree | 9d40511f1f6bffb63ce14046404744e7bf7e3fe8 /sfx2 | |
parent | 36499d8bf6cd5c6af7b2ceb6071baf5c7421bd0a (diff) |
don't leak when the SfxHintPoster is disabled
Change-Id: Ia445feb93b7e65e1b64c69efded9a3e779cb578e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115405
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/notify/hintpost.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sfx2/source/notify/hintpost.cxx b/sfx2/source/notify/hintpost.cxx index 0020d3beac69..446c7a954ba9 100644 --- a/sfx2/source/notify/hintpost.cxx +++ b/sfx2/source/notify/hintpost.cxx @@ -37,8 +37,11 @@ void SfxHintPoster::Post(std::unique_ptr<SfxRequest> pHintToPost) IMPL_LINK(SfxHintPoster, DoEvent_Impl, void*, pPostedHint, void) { + auto pRequest = static_cast<SfxRequest*>(pPostedHint); if (m_Link) - m_Link(std::unique_ptr<SfxRequest>(static_cast<SfxRequest*>(pPostedHint))); + m_Link(std::unique_ptr<SfxRequest>(pRequest)); + else + delete pRequest; ReleaseRef(); } |