basic/source/runtime/basrdll.cxx |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 08a2de20238e250d5ddf8cc43341a9f48ed9d759
Author:     Arnaud Versini <arnaud.vers...@libreoffice.org>
AuthorDate: Tue Sep 19 16:17:38 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Sep 20 08:07:30 2023 +0200

    basic : remove useless allocation in BasicDLLImpl
    
    Change-Id: I8e2628da08cb621087915dcfb4d55ddacfeaabc1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157048
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/basic/source/runtime/basrdll.cxx b/basic/source/runtime/basrdll.cxx
index ba94fd7b9d2b..853863b4fcfd 100644
--- a/basic/source/runtime/basrdll.cxx
+++ b/basic/source/runtime/basrdll.cxx
@@ -37,12 +37,11 @@ struct BasicDLLImpl : public SvRefBase
     bool        bDebugMode;
     bool        bBreakEnabled;
 
-    std::unique_ptr<SbxAppData> xSbxAppData;
+    SbxAppData aSbxAppData;
 
     BasicDLLImpl()
         : bDebugMode(false)
         , bBreakEnabled(true)
-        , xSbxAppData(new SbxAppData)
     { }
 
     static BasicDLLImpl* BASIC_DLL;
@@ -69,7 +68,7 @@ BasicDLL::~BasicDLL()
     std::scoped_lock aGuard(BasicDLLImpl::getMutex());
     const bool bLastRef = m_xImpl->GetRefCount() == 1;
     if (bLastRef) {
-        BasicDLLImpl::BASIC_DLL->xSbxAppData->m_aGlobErr.clear();
+        BasicDLLImpl::BASIC_DLL->aSbxAppData.m_aGlobErr.clear();
     }
     m_xImpl.clear();
     // only reset BASIC_DLL after the object had been destroyed
@@ -122,12 +121,12 @@ void BasicDLL::BasicBreak()
 
 SbxAppData& GetSbxData_Impl()
 {
-    return *BasicDLLImpl::BASIC_DLL->xSbxAppData;
+    return BasicDLLImpl::BASIC_DLL->aSbxAppData;
 }
 
 bool IsSbxData_Impl()
 {
-    return BasicDLLImpl::BASIC_DLL && BasicDLLImpl::BASIC_DLL->xSbxAppData;
+    return BasicDLLImpl::BASIC_DLL;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to