Commit 36c6cfec authored by Elvis Angelaccio's avatar Elvis Angelaccio
Browse files

Part: fix memory leak

m_fileWatcher was never getting deleted.
parent 27973370
......@@ -1036,8 +1036,8 @@ void Part::slotOpenExtractedEntry(KJob *job)
const QString fullName = openJob->validatedFilePath();
if (isArchiveWritable()) {
m_fileWatcher = new QFileSystemWatcher;
connect(m_fileWatcher, &QFileSystemWatcher::fileChanged, this, &Part::slotWatchedFileModified);
m_fileWatcher.reset(new QFileSystemWatcher);
connect(m_fileWatcher.get(), &QFileSystemWatcher::fileChanged, this, &Part::slotWatchedFileModified);
m_fileWatcher->addPath(fullName);
} else {
// If archive is readonly set temporarily extracted file to readonly as
......
......@@ -231,7 +231,7 @@ private:
KAbstractWidgetJobTracker *m_jobTracker;
KParts::StatusBarExtension *m_statusBarExtension;
QVBoxLayout *m_vlayout;
QFileSystemWatcher *m_fileWatcher;
std::unique_ptr<QFileSystemWatcher> m_fileWatcher;
QSplitter *m_commentSplitter;
QGroupBox *m_commentBox;
QPlainTextEdit *m_commentView;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment