forked from qt-creator/qt-creator
Add flag to IPlugin::aboutToShutdown that allows asynchronous shutdown.
If a plugin requests asyncronous shutdown, the shutdown sequence does not continue to deleting the plugins before it has sent a asynchronousShutdownFinished signal. During that time an event loop is running.
This commit is contained in:
@@ -49,12 +49,17 @@ class EXTENSIONSYSTEM_EXPORT IPlugin : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum ShutdownFlag {
|
||||
SynchronousShutdown,
|
||||
AsynchronousShutdown
|
||||
};
|
||||
|
||||
IPlugin();
|
||||
virtual ~IPlugin();
|
||||
|
||||
virtual bool initialize(const QStringList &arguments, QString *errorString) = 0;
|
||||
virtual void extensionsInitialized() = 0;
|
||||
virtual void aboutToShutdown() { }
|
||||
virtual ShutdownFlag aboutToShutdown() { return SynchronousShutdown; }
|
||||
virtual void remoteCommand(const QStringList & /* options */, const QStringList & /* arguments */) { }
|
||||
|
||||
PluginSpec *pluginSpec() const;
|
||||
@@ -63,6 +68,9 @@ public:
|
||||
void addAutoReleasedObject(QObject *obj);
|
||||
void removeObject(QObject *obj);
|
||||
|
||||
signals:
|
||||
void asynchronousShutdownFinished();
|
||||
|
||||
private:
|
||||
Internal::IPluginPrivate *d;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user