mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Stop leaking PropagateDownloadEncrypted objects
We give them a parent to make sure they will be destroyed when the jobs which created them are destroyed themselves. Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
This commit is contained in:
parent
01d44dd3a1
commit
2abc3ce2f5
@ -344,7 +344,7 @@ void PropagateDownloadFile::start()
|
||||
qCDebug(lcPropagateDownload) << _item->_file << propagator()->_activeJobList.count();
|
||||
|
||||
if (propagator()->account()->capabilities().clientSideEncryptionAvailable()) {
|
||||
_downloadEncryptedHelper = new PropagateDownloadEncrypted(propagator(), _item);
|
||||
_downloadEncryptedHelper = new PropagateDownloadEncrypted(propagator(), _item, this);
|
||||
connect(_downloadEncryptedHelper, &PropagateDownloadEncrypted::folderStatusNotEncrypted, [this] {
|
||||
startAfterIsEncryptedIsChecked();
|
||||
});
|
||||
|
||||
@ -6,9 +6,11 @@ Q_LOGGING_CATEGORY(lcPropagateDownloadEncrypted, "nextcloud.sync.propagator.down
|
||||
|
||||
namespace OCC {
|
||||
|
||||
PropagateDownloadEncrypted::PropagateDownloadEncrypted(OwncloudPropagator *propagator, SyncFileItemPtr item) :
|
||||
_propagator(propagator), _item(item), _info(_item->_file)
|
||||
|
||||
PropagateDownloadEncrypted::PropagateDownloadEncrypted(OwncloudPropagator *propagator, SyncFileItemPtr item, QObject *parent)
|
||||
: QObject(parent)
|
||||
, _propagator(propagator)
|
||||
, _item(item)
|
||||
, _info(_item->_file)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ namespace OCC {
|
||||
class PropagateDownloadEncrypted : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
PropagateDownloadEncrypted(OwncloudPropagator *propagator, SyncFileItemPtr item);
|
||||
PropagateDownloadEncrypted(OwncloudPropagator *propagator, SyncFileItemPtr item, QObject *parent = nullptr);
|
||||
void start();
|
||||
void checkFolderId(const QStringList &list);
|
||||
bool decryptFile(QFile& tmpFile);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user