Terminal: Fix possible double lock
Check if fMouseClipboard is be_clipboard, and do nothing in that case. This could happen if SetMouseClipboard has never been called, for example when running as a replicant. Also updated copyright year. Change-Id: I2468d80404c429797bd8c906f3aa747ffc414fa8 Reviewed-on: https://review.haiku-os.org/c/haiku/+/9309 Tested-by: Commit checker robot <[email protected]> Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
0ec1d4526c
commit
e88cfea6cf
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2001-2023, Haiku, Inc. All rights reserved.
|
||||
* Copyright 2001-2025, Haiku, Inc. All rights reserved.
|
||||
* Copyright 2003-2004 Kian Duffy, [email protected]
|
||||
* Parts Copyright 1998-1999 Kazuho Okui and Takashi Murai.
|
||||
* All rights reserved. Distributed under the terms of the MIT license.
|
||||
@@ -1695,7 +1695,7 @@ TermView::MessageReceived(BMessage *message)
|
||||
// This message originates from the system clipboard. Overwrite
|
||||
// the contents of the mouse clipboard with the ones from the
|
||||
// system clipboard, in case it contains text data.
|
||||
if (be_clipboard->Lock()) {
|
||||
if (be_clipboard != fMouseClipboard && be_clipboard->Lock()) {
|
||||
if (fMouseClipboard->Lock()) {
|
||||
BMessage* clipMsgA = be_clipboard->Data();
|
||||
const char* text;
|
||||
|
||||
Reference in New Issue
Block a user