diff options
-rw-r--r-- | basic/source/classes/sb.cxx | 10 | ||||
-rw-r--r-- | include/basic/sbmod.hxx | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 3c678f6a8219..9720031dfc1a 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -604,7 +604,6 @@ SbxObjectRef createUserTypeImpl( const OUString& rClassName ) return pRetObj; } - SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) : SbModule( pClassModule->GetName() ) , mpClassModule( pClassModule ) @@ -612,8 +611,8 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) { aOUSource = pClassModule->aOUSource; aComment = pClassModule->aComment; - // see comment in destructor about these two - pImage.reset(pClassModule->pImage.get()); + pImage = pClassModule->pImage; + // see comment in destructor about this pBreaks = pClassModule->pBreaks; SetClassName( pClassModule->GetName() ); @@ -757,9 +756,8 @@ SbClassModuleObject::~SbClassModuleObject() if( !pDocBasicItem->isDocClosed() ) triggerTerminateEvent(); - // prevent the base class destructor from deleting this because: - // coverity[leaked_storage] - we do not actually own it - pImage.release(); + // prevent the base class destructor from deleting this because + // we do not actually own it pBreaks = nullptr; } diff --git a/include/basic/sbmod.hxx b/include/basic/sbmod.hxx index 0463ae13f90f..66b90a4f2a52 100644 --- a/include/basic/sbmod.hxx +++ b/include/basic/sbmod.hxx @@ -63,7 +63,7 @@ protected: css::uno::Reference< css::script::XInvocation > mxWrapper; OUString aOUSource; OUString aComment; - std::unique_ptr<SbiImage> pImage; // the Image + std::shared_ptr<SbiImage> pImage; // the Image SbiBreakpoints* pBreaks; // Breakpoints std::unique_ptr<SbClassData> pClassData; bool mbVBASupport; // Option VBASupport |