Bug 1771823 - Don't clear system clipboard when exiting Firefox. r=mac-reviewers,spohl a=pascalc
author Makoto Kato <m_kato@ga2.so-net.ne.jp>
Thu, 02 Jun 2022 01:27:33 +0000
changeset 689870 6b7caf4b0c9be306fbbfb191bd82cd84a2b1df6f
parent 689869 635c2b619ed38db756f9f8d88c39d9f31bf611b4
child 689871 2b589ed16c00209379533f5e54fe974582047e21
push id 16727
push user pchevrel@mozilla.com
push date Mon, 06 Jun 2022 15:57:58 +0000
treeherder mozilla-beta@020995d6f38d [default view] [failures only]
perfherder [talos] [build metrics] [platform microbench] (compared to previous push)
reviewers mac-reviewers, spohl, pascalc
bugs 1771823, 666254
milestone 102.0
Bug 1771823 - Don't clear system clipboard when exiting Firefox. r=mac-reviewers,spohl a=pascalc This is regression by bug 666254. We shouldn't call `nsClipborad::EmptyClipboard()` in destructor. Cached `nsITransferable` will be cleared by nsBaseClipboard()'s destructor. Differential Revision: https://phabricator.services.mozilla.com/D147834
widget/cocoa/nsClipboard.mm
--- a/widget/cocoa/nsClipboard.mm
+++ b/widget/cocoa/nsClipboard.mm
@@ -58,18 +58,16 @@ mozilla::StaticRefPtr<nsITransferable> n
   return result;
 }
 
 @end  // UTIHelper
 
 nsClipboard::nsClipboard() : nsBaseClipboard(), mCachedClipboard(-1), mChangeCount(0) {}
 
 nsClipboard::~nsClipboard() {
-  EmptyClipboard(kGlobalClipboard);
-  EmptyClipboard(kFindClipboard);
   ClearSelectionCache();
 }
 
 NS_IMPL_ISUPPORTS_INHERITED0(nsClipboard, nsBaseClipboard)
 
 // We separate this into its own function because after an @try, all local
 // variables within that function get marked as volatile, and our C++ type
 // system doesn't like volatile things.