sfx2/source/notify/hintpost.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
New commits: commit da6c8343993c4d5c0e7b60eebe27a611def7f250 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue May 11 15:03:11 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue May 11 17:28:43 2021 +0200 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.gran...@collabora.co.uk> 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(); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits