diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-05-11 09:45:13 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-05-11 12:51:19 +0200 |
commit | 5ed6aae8b572fd2b7623454acbb1de791f166c45 (patch) | |
tree | f860891272d5a6a83a739040a30612cc2f36c293 /sfx2/source | |
parent | eb6819e74a66750235d3a4a894479faeee8146e2 (diff) |
fix leak in LOKPostAsyncEvent
Change-Id: I0bae5c59d75b315c1c086640a8a9bb638a82923d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115381
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 0487ff96922e..389c45392b46 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -612,9 +612,11 @@ namespace void LOKPostAsyncEvent(void* pEv, void*) { - LOKAsyncEventData* pLOKEv = static_cast<LOKAsyncEventData*>(pEv); + std::unique_ptr<LOKAsyncEventData> pLOKEv(static_cast<LOKAsyncEventData*>(pEv)); if (pLOKEv->mpWindow->IsDisposed()) + { return; + } int nView = SfxLokHelper::getView(nullptr); if (nView != pLOKEv->mnView) @@ -676,8 +678,6 @@ namespace assert(false); break; } - - delete pLOKEv; } void postEventAsync(LOKAsyncEventData *pEvent) |