sb118: fixed aqua_clipboard mutex lock scope
This commit is contained in:
@@ -192,6 +192,10 @@ void SAL_CALL AquaClipboard::setContents(const Reference<XTransferable>& xTransf
|
|||||||
const Reference<XClipboardOwner>& xClipboardOwner)
|
const Reference<XClipboardOwner>& xClipboardOwner)
|
||||||
throw( RuntimeException )
|
throw( RuntimeException )
|
||||||
{
|
{
|
||||||
|
NSArray* types = xTransferable.is() ?
|
||||||
|
mpDataFlavorMapper->flavorSequenceToTypesArray(xTransferable->getTransferDataFlavors()) :
|
||||||
|
[NSArray array];
|
||||||
|
|
||||||
ClearableMutexGuard aGuard(m_aMutex);
|
ClearableMutexGuard aGuard(m_aMutex);
|
||||||
|
|
||||||
Reference<XClipboardOwner> oldOwner(mXClipboardOwner);
|
Reference<XClipboardOwner> oldOwner(mXClipboardOwner);
|
||||||
@@ -200,11 +204,10 @@ void SAL_CALL AquaClipboard::setContents(const Reference<XTransferable>& xTransf
|
|||||||
Reference<XTransferable> oldContent(mXClipboardContent);
|
Reference<XTransferable> oldContent(mXClipboardContent);
|
||||||
mXClipboardContent = xTransferable;
|
mXClipboardContent = xTransferable;
|
||||||
|
|
||||||
NSArray* types = mXClipboardContent.is() ?
|
|
||||||
mpDataFlavorMapper->flavorSequenceToTypesArray(mXClipboardContent->getTransferDataFlavors()) :
|
|
||||||
[NSArray array];
|
|
||||||
mPasteboardChangeCount = [mPasteboard declareTypes: types owner: mEventListener];
|
mPasteboardChangeCount = [mPasteboard declareTypes: types owner: mEventListener];
|
||||||
|
|
||||||
|
aGuard.clear();
|
||||||
|
|
||||||
// if we are already the owner of the clipboard
|
// if we are already the owner of the clipboard
|
||||||
// then fire lost ownership event
|
// then fire lost ownership event
|
||||||
if (oldOwner.is())
|
if (oldOwner.is())
|
||||||
@@ -256,7 +259,7 @@ void SAL_CALL AquaClipboard::removeClipboardListener(const Reference< XClipboard
|
|||||||
|
|
||||||
void AquaClipboard::applicationDidBecomeActive(NSNotification* aNotification)
|
void AquaClipboard::applicationDidBecomeActive(NSNotification* aNotification)
|
||||||
{
|
{
|
||||||
MutexGuard aGuard(m_aMutex);
|
ClearableMutexGuard aGuard(m_aMutex);
|
||||||
|
|
||||||
int currentPboardChgCount = [mPasteboard changeCount];
|
int currentPboardChgCount = [mPasteboard changeCount];
|
||||||
|
|
||||||
@@ -273,6 +276,8 @@ void AquaClipboard::applicationDidBecomeActive(NSNotification* aNotification)
|
|||||||
Reference<XTransferable> oldContent(mXClipboardContent);
|
Reference<XTransferable> oldContent(mXClipboardContent);
|
||||||
mXClipboardContent = Reference<XTransferable>();
|
mXClipboardContent = Reference<XTransferable>();
|
||||||
|
|
||||||
|
aGuard.clear();
|
||||||
|
|
||||||
if (oldOwner.is())
|
if (oldOwner.is())
|
||||||
{
|
{
|
||||||
fireLostClipboardOwnershipEvent(oldOwner, oldContent);
|
fireLostClipboardOwnershipEvent(oldOwner, oldContent);
|
||||||
|
Reference in New Issue
Block a user