vcl/source/app/svapp.cxx |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 33972c49d59b3dd7bb8c361e1099cf457194ce93
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed May 19 13:19:36 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed May 19 14:44:14 2021 +0200

    Revert "fix leak when LOK not active"
    
    This reverts commit fd6bdd1a3ec7925b7208a0341248e09b02800795.
    
    I was mistaken, the caller is responsible for freeing the memory
    of the payload.
    
    Change-Id: I0f140640cfa03a3ef626704ae60783f46a661186
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115798
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 0e74c7b8ee7e..ecfaa3805bef 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -322,13 +322,13 @@ void Application::notifyWindow(vcl::LOKWindowId 
/*nLOKWindowId*/,
 
 void Application::libreOfficeKitViewCallback(int nType, const char* pPayload) 
const
 {
-    if (!comphelper::LibreOfficeKit::isActive() || !m_pCallback)
-    {
-        free(static_cast<void*>(const_cast<char*>(pPayload)));
+    if (!comphelper::LibreOfficeKit::isActive())
         return;
-    }
 
-    m_pCallback(nType, pPayload, m_pCallbackData);
+    if (m_pCallback)
+    {
+        m_pCallback(nType, pPayload, m_pCallbackData);
+    }
 }
 
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to