Review Mozilla 1834374: Do not call EmptyClipboard() in nsBaseClipboard destructor
So this patch is correct in terms of the undefined behaviour aspects: by the time the nsBaseClipboard destructor is called on the object, its implementing class's destructor would have already been called, so calling virtual methods is undefined/broken (since they may touch data that has already been destructed).
Now, we may still want to call EmptyClipboard() on destruction (but correctly).
To whomever writes this potential patch, please read up on destruction order/virtual destructors so we don't re-introduce undefined behaviour.
@donuts do you think we would want this behaviour gated on private browsing only mode (clearing clipboard on exit).
@ma1 can we clear clipboard contents iff the contents were placed there by the browser?
@ruihildt if we do want this in Tor Browser, do you think we would also want this in Mullvad Browser? The fix is new in FF115 so iirc the current Mullvad Browser is clearing the clipboard on exit.