summaryrefslogtreecommitdiff
path: root/vcl/source/app
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-08-25 22:15:09 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-08-26 13:34:05 +0200
commit6b50f11fafad9b934bef24259ebf90fbfb1d0a30 (patch)
tree10fc89c1e2fb6eda30753adfa51da03ddc034239 /vcl/source/app
parentf6c0803e9984e716f5ba86a0271ecad7e0ed61d8 (diff)
fix nasty memory leak on shutdown
This makes the output of Lsan so much more useful. Change-Id: I6c7624d4f6f767454c125c00ce037f5d2ec3cd61
Diffstat (limited to 'vcl/source/app')
-rw-r--r--vcl/source/app/idlemgr.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/vcl/source/app/idlemgr.cxx b/vcl/source/app/idlemgr.cxx
index cd41d1260caa..fbbd14159ec1 100644
--- a/vcl/source/app/idlemgr.cxx
+++ b/vcl/source/app/idlemgr.cxx
@@ -30,7 +30,8 @@ struct ImplIdleData
#define IMPL_IDLETIMEOUT 350
-ImplIdleMgr::ImplIdleMgr()
+ImplIdleMgr::ImplIdleMgr():
+ mbInDestruction(false)
{
mpIdleList = new ImplIdleList();
@@ -40,9 +41,12 @@ ImplIdleMgr::ImplIdleMgr()
ImplIdleMgr::~ImplIdleMgr()
{
+ mbInDestruction = true;
// Liste loeschen
for ( size_t i = 0, n = mpIdleList->size(); i < n; ++i ) {
- delete (*mpIdleList)[ i ];
+ ImplIdleData* pIdleData = (*mpIdleList)[ i ];
+ pIdleData->maIdleHdl.Call( GetpApp() );
+ delete pIdleData;
}
mpIdleList->clear();
delete mpIdleList;
@@ -84,6 +88,9 @@ bool ImplIdleMgr::InsertIdleHdl( const Link& rLink, sal_uInt16 nPriority )
void ImplIdleMgr::RemoveIdleHdl( const Link& rLink )
{
+ if (mbInDestruction)
+ return;
+
for ( ImplIdleList::iterator it = mpIdleList->begin(); it != mpIdleList->end(); ++it ) {
if ( (*it)->maIdleHdl == rLink ) {
delete *it;