diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-06-02 11:12:11 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-06-02 11:12:11 +0200 |
commit | 6b4c596b01039324cfe78f38c4e3ffb9080bcd34 (patch) | |
tree | 631f1570a3277a00f59ccbc8c31261eeadf3903e /basic | |
parent | 8e115c60081b245541408889295bc0c147091e0c (diff) |
Fix memory leak for BASIC sub (as well as void function)
d88593af59d9126cdbcd6c0a5b06fb9c673dc6f9 "INTEGRATION: CWS ab34: #i73457#
Prevent sub from beeing set as param 0 for return type void" to fix i#73457
"Memory Leak in all Basic type void Method calls" had made the PutDirect call
dependent on != SbxVOID only (which would cover void functions) but not also on
!= SbxEMPTY (which would apparently be required to also cover subs, as seen with
CppunitTest_basic_vba run under lsan). Either this was an oversight with the
original fix, or subs have meanwhile changed from GetType() == SbxVOID to
SbxEMPTY?
Change-Id: I3e5dbf79bfd5eea3cfec8ed3fa984d13167aa501
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/classes/sbxmod.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 078a4f941ac9..6713e4be262f 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -2172,9 +2172,15 @@ void SbMethod::Broadcast( sal_uIntPtr nHintId ) if( mpPar.Is() ) { // Enrigister this as element 0, but don't reset the parent! - if( GetType() != SbxVOID ) + switch( GetType() ) { + case SbxEMPTY: + case SbxVOID: + break; + default: mpPar->PutDirect( pThisCopy, 0 ); - SetParameters( NULL ); + break; + } + SetParameters( NULL ); } pCst = pSave; |