diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 09:29:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 09:29:03 +0000 |
commit | 5a7157d319477830426797532e02ac39d3b859f4 (patch) | |
tree | 3773f5ce209bee14a5643e98672e0f3828c71434 /xmlsecurity/inc | |
parent | Releasing progress-linux version 4:24.2.0-3~progress7.99u1. (diff) | |
download | libreoffice-5a7157d319477830426797532e02ac39d3b859f4.tar.xz libreoffice-5a7157d319477830426797532e02ac39d3b859f4.zip |
Merging upstream version 4:24.2.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xmlsecurity/inc')
-rw-r--r-- | xmlsecurity/inc/certificatechooser.hxx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/xmlsecurity/inc/certificatechooser.hxx b/xmlsecurity/inc/certificatechooser.hxx index 12303fbf1c..b0cf7c7cdc 100644 --- a/xmlsecurity/inc/certificatechooser.hxx +++ b/xmlsecurity/inc/certificatechooser.hxx @@ -51,8 +51,6 @@ enum class UserAction class CertificateChooser final : public weld::GenericDialogController { private: - static inline CertificateChooser* mxInstance = nullptr; - std::vector< css::uno::Reference< css::xml::crypto::XXMLSecurityContext > > mxSecurityContexts; std::vector<std::shared_ptr<UserData>> mvUserData; @@ -91,14 +89,18 @@ public: UserAction eAction); virtual ~CertificateChooser() override; - static CertificateChooser* getInstance(weld::Window* _pParent, + static std::unique_ptr<CertificateChooser> getInstance(weld::Window* _pParent, std::vector< css::uno::Reference< css::xml::crypto::XXMLSecurityContext > > && rxSecurityContexts, UserAction eAction) { - if (!mxInstance) - { - mxInstance = new CertificateChooser(_pParent, std::move(rxSecurityContexts), eAction); - } - return mxInstance; + // Don't reuse CertificateChooser instances + // Reusing the same instance will, in the following case, lead to a + // crash. It appears that the CertificateChooser is getting disposed + // somewhere as mpDialogImpl in its base class ends up being null: + // 1. Create an empty Writer document and add a digital signature + // in the Digital Signatures dialog + // 2. File > Save As the document, check the "Encrypt with GPG key" + // checkbox, press Encrypt, and crash in Dialog::ImplStartExecute() + return std::make_unique<CertificateChooser>(_pParent, std::move(rxSecurityContexts), eAction); } short run() override; |