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
--- 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.