Bug 1771823 - Don't clear system clipboard when exiting Firefox. r=mac-reviewers,spohl
author Makoto Kato <m_kato@ga2.so-net.ne.jp>
Thu, 02 Jun 2022 01:27:33 +0000
changeset 619503 fcab49b1287126e5f24add4d64e0df5311689ed9
parent 619502 f0457dfa02f2ca98464dd02f8965a8d150056ff7
child 619504 6a1a61daa78fb86110da92ab068b08f2e49b6609
push id 39787
push user imoraru@mozilla.com
push date Thu, 02 Jun 2022 21:46:37 +0000
treeherder mozilla-central@b59e3edd8f6e [default view] [failures only]
perfherder [talos] [build metrics] [platform microbench] (compared to previous push)
reviewers mac-reviewers, spohl
bugs 1771823, 666254
milestone 103.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1771823 - Don't clear system clipboard when exiting Firefox. r=mac-reviewers,spohl 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.