Bug 1771823 - Don't clear system clipboard when exiting Firefox. r=mac-reviewers,spohl a=RyanVM
author Makoto Kato <m_kato@ga2.so-net.ne.jp>
Thu, 02 Jun 2022 01:27:33 +0000
changeset 691061 a2e465fa1db71b5c07ea323b7f3517d57692bee6
parent 691060 31090992bf20803c7c43c2642a47bed16dd12078
child 691062 a75868801051207db716a5d6d14fb8be5471ffec
push id 2870
push user ryanvm@gmail.com
push date Wed, 08 Jun 2022 16:23:52 +0000
treeherder mozilla-release@a2e465fa1db7 [default view] [failures only]
perfherder [talos] [build metrics] [platform microbench] (compared to previous push)
reviewers mac-reviewers, spohl, RyanVM
bugs 1771823, 666254
milestone 101.0.1
Bug 1771823 - Don't clear system clipboard when exiting Firefox. r=mac-reviewers,spohl a=RyanVM 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.