Bugzilla – Attachment 125590 Details for
Bug 88985
Writer crashes document if closed while macro running
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
this moves the crash from the current place to later on
move.crash.to.later.patch (text/plain), 4.95 KB, created by
Caolán McNamara
on 2016-06-10 16:35:23 UTC
(
hide
)
Description:
this moves the crash from the current place to later on
Filename:
MIME Type:
Creator:
Caolán McNamara
Created:
2016-06-10 16:35:23 UTC
Size:
4.95 KB
patch
obsolete
>diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx >index 9bf4cda..bdd56ef 100644 >--- a/basic/source/classes/sb.cxx >+++ b/basic/source/classes/sb.cxx >@@ -914,8 +914,10 @@ SbModule* SbClassFactory::FindClass( const OUString& rClassName ) > return pMod; > } > >-StarBASIC::StarBASIC( StarBASIC* p, bool bIsDocBasic ) >- : SbxObject( OUString("StarBASIC") ), bDocBasic( bIsDocBasic ) >+StarBASIC::StarBASIC(StarBASIC* p, bool bIsDocBasic) >+ : SbxObject(OUString("StarBASIC")) >+ , xParent(p) >+ , bDocBasic(bIsDocBasic) > { > SetParent( p ); > pLibInfo = nullptr; >diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx >index 375678f..35d977a 100644 >--- a/basic/source/classes/sbxmod.cxx >+++ b/basic/source/classes/sbxmod.cxx >@@ -1027,7 +1027,9 @@ void ClearUnoObjectsInRTL_Impl( StarBASIC* pBasic ) > // Search for the topmost Basic > SbxObject* p = pBasic; > while( p->GetParent() ) >+ { > p = p->GetParent(); >+ } > if( static_cast<StarBASIC*>(p) != pBasic ) > ClearUnoObjectsInRTL_Impl_Rek( static_cast<StarBASIC*>(p) ); > } >@@ -2092,6 +2094,8 @@ SbxInfo* SbMethod::GetInfo() > // The return value will be delivered as string. > ErrCode SbMethod::Call( SbxValue* pRet, SbxVariable* pCaller ) > { >+ rtl::Reference<BasicDLL> xEnsureErrorCodeStorageLifeCycle(BasicDLL::AcquireReference()); >+ > if ( pCaller ) > { > SAL_INFO("basic", "SbMethod::Call Have been passed a caller 0x" << pCaller ); >diff --git a/basic/source/runtime/basrdll.cxx b/basic/source/runtime/basrdll.cxx >index e10b7b3..71f4b87 100644 >--- a/basic/source/runtime/basrdll.cxx >+++ b/basic/source/runtime/basrdll.cxx >@@ -66,6 +66,23 @@ BasicDLL::~BasicDLL() > { > } > >+static rtl::Reference<BasicDLL> xBasic; >+ >+void BasicDLL::Initialize() >+{ >+ xBasic.set(new BasicDLL); >+} >+ >+void BasicDLL::DeInitialize() >+{ >+ xBasic.clear(); >+} >+ >+rtl::Reference<BasicDLL> BasicDLL::AcquireReference() >+{ >+ return xBasic; >+} >+ > ResMgr* BasicDLL::GetBasResMgr() const { return m_xImpl->xBasResMgr.get(); } > > void BasicDLL::EnableBreak( bool bEnable ) >diff --git a/include/basic/basrdll.hxx b/include/basic/basrdll.hxx >index 623ec6a..da4b345 100644 >--- a/include/basic/basrdll.hxx >+++ b/include/basic/basrdll.hxx >@@ -21,11 +21,13 @@ > #define INCLUDED_BASIC_BASRDLL_HXX > > #include <basic/basicdllapi.h> >+#include <rtl/ref.hxx> >+#include <salhelper/simplereferenceobject.hxx> > #include <memory> > > class ResMgr; > >-class BASIC_DLLPUBLIC BasicDLL >+class BASIC_DLLPUBLIC BasicDLL : public salhelper::SimpleReferenceObject > { > public: > struct Impl; >@@ -41,6 +43,10 @@ public: > > static void EnableBreak( bool bEnable ); > static void SetDebugMode( bool bDebugMode ); >+ >+ static void Initialize(); >+ static rtl::Reference<BasicDLL> AcquireReference(); >+ static void DeInitialize(); > }; > > #endif // INCLUDED_BASIC_BASRDLL_HXX >diff --git a/include/basic/sbstar.hxx b/include/basic/sbstar.hxx >index 1fda1b5..ef84cfb 100644 >--- a/include/basic/sbstar.hxx >+++ b/include/basic/sbstar.hxx >@@ -41,6 +41,10 @@ class SbMethod; > class BasicManager; > class DocBasicItem; > >+class StarBASIC; >+ >+typedef tools::SvRef<StarBASIC> StarBASICRef; >+ > class BASIC_DLLPUBLIC StarBASIC : public SbxObject > { > friend class SbiScanner; >@@ -50,8 +54,9 @@ class BASIC_DLLPUBLIC StarBASIC : public SbxObject > friend class DocBasicItem; > > SbModules pModules; // List of all modules >- SbxObjectRef pRtl; // Runtime Library >+ SbxObjectRef pRtl; // Runtime Library > SbxArrayRef xUnoListeners; // Listener handled by CreateUnoListener >+ StarBASICRef xParent; > > // Handler-Support: > Link<StarBASIC*,bool> aErrorHdl; // Error handler >@@ -165,8 +170,6 @@ public: > static void DetachAllDocBasicItems(); > }; > >-typedef tools::SvRef<StarBASIC> StarBASICRef; >- > #endif > > /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ >diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx >index 8619727..507b0aa 100644 >--- a/sfx2/source/appl/app.cxx >+++ b/sfx2/source/appl/app.cxx >@@ -106,10 +106,6 @@ using namespace ::com::sun::star; > > static SfxApplication* g_pSfxApplication = nullptr; > >-#if HAVE_FEATURE_SCRIPTING >-static BasicDLL* pBasic = nullptr; >-#endif >- > #if HAVE_FEATURE_DESKTOP > static SfxHelp* pSfxHelp = nullptr; > #endif >@@ -196,12 +192,13 @@ SfxApplication::SfxApplication() > #endif > > #if HAVE_FEATURE_SCRIPTING >- pBasic = new BasicDLL; >+ BasicDLL::Initialize(); > StarBASIC::SetGlobalErrorHdl( LINK( this, SfxApplication, GlobalBasicErrorHdl_Impl ) ); > #endif > SAL_INFO( "sfx.appl", "} initialize DDE" ); > } > >+ > SfxApplication::~SfxApplication() > { > OSL_ENSURE( GetObjectShells_Impl().size() == 0, "Memory leak: some object shells were not removed!" ); >@@ -223,7 +220,7 @@ SfxApplication::~SfxApplication() > Deinitialize(); > > #if HAVE_FEATURE_SCRIPTING >- delete pBasic; >+ BasicDLL::DeInitialize(); > #endif > > g_pSfxApplication = nullptr;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 88985
:
113002
| 125590