From 21d5e71d486da8e37cf53f2b968646b39a6daa72 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Wed, 10 Aug 2016 12:04:16 +0200 Subject: [PATCH] Cpp: Clarify ownership of provider classes * lang/cpp/src/context.h: Note that the context does not take ownership of providers. --- lang/cpp/src/context.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lang/cpp/src/context.h b/lang/cpp/src/context.h index c7c0ecb9..70ab079f 100644 --- a/lang/cpp/src/context.h +++ b/lang/cpp/src/context.h @@ -102,9 +102,23 @@ public: void addKeyListMode(unsigned int keyListMode); unsigned int keyListMode() const; + /** Set the passphrase provider + * + * To avoid problems where a class using a context registers + * itself as the provider the Context does not take ownership + * of the provider and the caller must ensure that the provider + * is deleted if it is no longer needed. + */ void setPassphraseProvider(PassphraseProvider *provider); PassphraseProvider *passphraseProvider() const; + /** Set the progress provider + * + * To avoid problems where a class using a context registers + * itself as the provider the Context does not take ownership + * of the provider and the caller must ensure that the provider + * is deleted if it is no longer needed. + */ void setProgressProvider(ProgressProvider *provider); ProgressProvider *progressProvider() const;