Skip to content

Commit

Permalink
Merge branch 'master' into 'master'
Browse files Browse the repository at this point in the history
[nemo-qml-plugin-filemanager] Avoid double deletion of FileEngine. Fixes JB#34723

QtQuick owns the instance given to qmlRegisterSingletonType().

@jpetrell 

See merge request !5
  • Loading branch information
jpetrell committed Apr 7, 2016
2 parents 5ea6ee6 + a52ee9a commit 8f337dd
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
8 changes: 0 additions & 8 deletions src/fileengine.cpp
Expand Up @@ -40,16 +40,13 @@
#include <QTextStream>
#include <unistd.h>

Q_GLOBAL_STATIC(FileEngine, engine);


FileEngine::FileEngine(QObject *parent) :
QObject(parent),
m_clipboardContainsCopy(false)
{
m_fileWorker = new FileWorker(this);


// pass worker end signals to QML
connect(m_fileWorker, &FileWorker::done, this, &FileEngine::workerDone);
connect(m_fileWorker, &FileWorker::cancelled, this, &FileEngine::cancelled);
Expand All @@ -69,11 +66,6 @@ FileEngine::~FileEngine()
m_fileWorker->wait(); // wait until thread stops
}

FileEngine *FileEngine::instance()
{
return engine();
}

FileEngine::Mode FileEngine::mode() const
{
return m_fileWorker->mode();
Expand Down
3 changes: 0 additions & 3 deletions src/fileengine.h
Expand Up @@ -81,9 +81,6 @@ class FileEngine : public QObject
bool busy() const;
Mode mode() const;

// For C++
static FileEngine *instance();

// methods accessible from QML

// asynch methods send signals when done or error occurs
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.cpp
Expand Up @@ -41,7 +41,7 @@

static QObject *engine_api_factory(QQmlEngine *, QJSEngine *)
{
return FileEngine::instance();
return new FileEngine;
}

class Q_DECL_EXPORT NemoFileManagerPlugin : public QQmlExtensionPlugin
Expand Down

0 comments on commit 8f337dd

Please sign in to comment.