summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/inc/idlemgr.hxx1
-rw-r--r--vcl/source/app/idlemgr.cxx11
2 files changed, 10 insertions, 2 deletions
diff --git a/vcl/inc/idlemgr.hxx b/vcl/inc/idlemgr.hxx
index 02fc85ec0985..4e0a6396b8cf 100644
--- a/vcl/inc/idlemgr.hxx
+++ b/vcl/inc/idlemgr.hxx
@@ -31,6 +31,7 @@ class ImplIdleMgr
private:
ImplIdleList* mpIdleList;
AutoTimer maTimer;
+ bool mbInDestruction;
public:
ImplIdleMgr();
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;