From e88cfea6cf100e7828822d60523d19b2466c4373 Mon Sep 17 00:00:00 2001 From: JackBurton79 Date: Tue, 27 May 2025 09:12:50 +0200 Subject: [PATCH] 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 Reviewed-by: Adrien Destugues --- src/apps/terminal/TermView.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apps/terminal/TermView.cpp b/src/apps/terminal/TermView.cpp index 919b03fee6..b43817410c 100644 --- a/src/apps/terminal/TermView.cpp +++ b/src/apps/terminal/TermView.cpp @@ -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, myob@users.sourceforge.net * 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;