diff options
author | Rüdiger Timm <rt@openoffice.org> | 2007-07-24 10:29:04 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2007-07-24 10:29:04 +0000 |
commit | 48598de64b48de2089599032877ebd27ee68320c (patch) | |
tree | 7884ff5e49c70e1171e41f12156a69493d55eb6f /automation/source/communi | |
parent | ffbb8ffb5660aece3b3b9f7aee3a11e6b509f3dd (diff) |
INTEGRATION: CWS gurke (1.7.4); FILE MERGED
2007/07/20 08:03:32 gh 1.7.4.1: #148724#testtool communication crashes on shutdown in Timer::Timeout
Diffstat (limited to 'automation/source/communi')
-rw-r--r-- | automation/source/communi/communi.cxx | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/automation/source/communi/communi.cxx b/automation/source/communi/communi.cxx index 68129a975802..665348f3effb 100644 --- a/automation/source/communi/communi.cxx +++ b/automation/source/communi/communi.cxx @@ -4,9 +4,9 @@ * * $RCSfile: communi.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: hr $ $Date: 2007-06-27 20:59:20 $ + * last change: $Author: rt $ $Date: 2007-07-24 11:29:04 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -286,6 +286,7 @@ IMPL_LINK( CommunicationLinkViaSocket, PutDataReceivedHdl, CommunicationLinkViaS MultiCommunicationManager::MultiCommunicationManager( BOOL bUseMultiChannel ) : CommunicationManager( bUseMultiChannel ) +, bGracefullShutdown( TRUE ) { ActiveLinks = new CommunicationLinkList; InactiveLinks = new CommunicationLinkList; @@ -295,21 +296,24 @@ MultiCommunicationManager::~MultiCommunicationManager() { StopCommunication(); - Timer aTimeout; - aTimeout.SetTimeout( 40000 ); - aTimeout.Start(); - USHORT nLinkCount = 0; - USHORT nNewLinkCount = 0; - while ( aTimeout.IsActive() ) + if ( bGracefullShutdown ) // first try to collect all callbacks for closing channels { - GetpApp()->Yield(); - nNewLinkCount = GetCommunicationLinkCount(); - if ( nNewLinkCount == 0 ) - aTimeout.Stop(); - if ( nNewLinkCount != nLinkCount ) + Timer aTimeout; + aTimeout.SetTimeout( 40000 ); + aTimeout.Start(); + USHORT nLinkCount = 0; + USHORT nNewLinkCount = 0; + while ( aTimeout.IsActive() ) { - aTimeout.Start(); - nLinkCount = nNewLinkCount; + GetpApp()->Yield(); + nNewLinkCount = GetCommunicationLinkCount(); + if ( nNewLinkCount == 0 ) + aTimeout.Stop(); + if ( nNewLinkCount != nLinkCount ) + { + aTimeout.Start(); + nLinkCount = nNewLinkCount; + } } } |