[Libreoffice-commits] online.git: loolwsd/ChildSession.cpp

Henry Castro hcastro at collabora.com
Mon May 30 00:34:52 UTC 2016


 loolwsd/ChildSession.cpp |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit c24ee3669ff0c7167d83f82276a228dbbe19188f
Author: Henry Castro <hcastro at collabora.com>
Date:   Sun May 29 20:34:24 2016 -0400

    loolwsd: deallocates more memory

diff --git a/loolwsd/ChildSession.cpp b/loolwsd/ChildSession.cpp
index ca0d430..59f96f7 100644
--- a/loolwsd/ChildSession.cpp
+++ b/loolwsd/ChildSession.cpp
@@ -652,7 +652,9 @@ bool ChildSession::sendFontRendering(const char* /*buffer*/, int /*length*/, Str
 
     Timestamp timestamp;
     int width, height;
-    std::unique_ptr<unsigned char[]> pixmap(_loKitDocument->renderFont(decodedFont.c_str(), &width, &height));
+    unsigned char* ptrFont = _loKitDocument->renderFont(decodedFont.c_str(), &width, &height);
+    std::unique_ptr<unsigned char[]> pixmap(ptrFont);
+    std::free(ptrFont);
     Log::trace("renderFont [" + font + "] rendered in " + std::to_string(timestamp.elapsed()/1000.) + "ms");
 
     if (!pixmap ||
@@ -708,7 +710,9 @@ bool ChildSession::getPartPageRectangles(const char* /*buffer*/, int /*length*/)
     if (_multiView)
         _loKitDocument->setView(_viewId);
 
-    sendTextFrame("partpagerectangles: " + std::string(_loKitDocument->getPartPageRectangles()));
+    char* partPage = _loKitDocument->getPartPageRectangles();
+    sendTextFrame("partpagerectangles: " + std::string(partPage));
+    std::free(partPage);
     return true;
 }
 


More information about the Libreoffice-commits mailing list