diff options
author | Oliver Bolte <obo@openoffice.org> | 2004-02-20 07:47:03 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2004-02-20 07:47:03 +0000 |
commit | 4df7758dbd43c722bab9e3b0f0b21c16a4311937 (patch) | |
tree | 66fd3658980ee9eb36d19754fd2b83c6d47313d6 /dtrans | |
parent | 4f9a1f1b4b9ec7bf3239be56864c331529cd4234 (diff) |
INTEGRATION: CWS vcl17 (1.9.52); FILE MERGED
2004/01/21 15:55:42 pl 1.9.52.3: RESYNC: (1.9-1.10); FILE MERGED
2003/12/08 16:48:33 pl 1.9.52.2: #114101# fixed some locking issues
2003/11/27 10:59:25 pl 1.9.52.1: #114101# removed a deadlock
Diffstat (limited to 'dtrans')
-rw-r--r-- | dtrans/source/X11/X11_clipboard.cxx | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/dtrans/source/X11/X11_clipboard.cxx b/dtrans/source/X11/X11_clipboard.cxx index ae737360d4f4..9642f944943c 100644 --- a/dtrans/source/X11/X11_clipboard.cxx +++ b/dtrans/source/X11/X11_clipboard.cxx @@ -2,9 +2,9 @@ * * $RCSfile: X11_clipboard.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: rt $ $Date: 2003-12-01 11:25:17 $ + * last change: $Author: obo $ $Date: 2004-02-20 08:47:03 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -181,16 +181,23 @@ void X11Clipboard::fireChangedContentsEvent() void X11Clipboard::clearContents() { - MutexGuard aGuard(m_aMutex); + ClearableMutexGuard aGuard(m_aMutex); + // protect against deletion during outside call + Reference< XClipboard > xThis( static_cast<XClipboard*>(this)); + // copy member references on stack so they can be called + // without having the mutex + Reference< XClipboardOwner > xOwner( m_aOwner ); + Reference< XTransferable > xTrans( m_aContents ); + // clear members + m_aOwner.clear(); + m_aContents.clear(); - if ( m_aOwner.is() ) - { - m_aOwner->lostOwnership(static_cast < XClipboard * > (this), m_aContents); - m_aOwner.clear(); - } + // release the mutex + aGuard.clear(); - // may be set even if no owner. - m_aContents.clear(); + // inform previous owner of lost ownership + if ( xOwner.is() ) + xOwner->lostOwnership(xThis, m_aContents); } // ------------------------------------------------------------------------ |