Cpp: Clarify ownership of provider classes

* lang/cpp/src/context.h: Note that the context does not take
ownership of providers.
This commit is contained in:
Andre Heinecke 2016-08-10 12:04:16 +02:00
parent 04f994d5db
commit 21d5e71d48

View File

@ -102,9 +102,23 @@ public:
void addKeyListMode(unsigned int keyListMode); void addKeyListMode(unsigned int keyListMode);
unsigned int keyListMode() const; 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); void setPassphraseProvider(PassphraseProvider *provider);
PassphraseProvider *passphraseProvider() const; 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); void setProgressProvider(ProgressProvider *provider);
ProgressProvider *progressProvider() const; ProgressProvider *progressProvider() const;