X-Git-Url: https://vaikene.ee/gitweb/pswgen09.html?a=blobdiff_plain;f=src%2Fplugins%2FSdiWindow%2Ffactory.cpp;h=24aa0e55df0bf3f92aba358032119451ac9562e9;hb=13dedf19c628b9967e4c4106ab0fd967f1df0b90;hp=5ce4d1a90651bbf75960853d8affe13f1a5bfff0;hpb=06f9c5336ba8a2200b68f636520707693eb5ada7;p=evaf
diff --git a/src/plugins/SdiWindow/factory.cpp b/src/plugins/SdiWindow/factory.cpp
index 5ce4d1a..24aa0e5 100644
--- a/src/plugins/SdiWindow/factory.cpp
+++ b/src/plugins/SdiWindow/factory.cpp
@@ -3,7 +3,7 @@
* @brief SDI module's factory class
* @author Enar Vaikene
*
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2019 Enar Vaikene
*
* This file is part of the eVaf C++ cross-platform application development framework.
*
@@ -19,7 +19,6 @@
#include "factory.h"
#include "sdiwindow.h"
-#include "version.h"
#include
@@ -28,14 +27,12 @@
using namespace eVaf::SdiWindow;
VER_EXPORT_VERSION_INFO()
-Q_EXPORT_PLUGIN2(VER_MODULE_NAME_STR, Factory)
//-------------------------------------------------------------------
Factory::Factory()
: Plugins::iPluginFactory()
- , mPlugin(0)
{
setObjectName(QString("%1-Factory").arg(VER_MODULE_NAME_STR));
@@ -44,8 +41,7 @@ Factory::Factory()
Factory::~Factory()
{
- if (mPlugin)
- delete mPlugin;
+ mPlugin.reset();
EVAF_INFO("%s destroyed", qPrintable(objectName()));
}
@@ -54,7 +50,7 @@ QObject * Factory::create(QString const & name)
{
Q_UNUSED(name);
- if (mPlugin == 0)
- mPlugin = new Internal::SdiWindowPlugin;
- return mPlugin;
+ if (!mPlugin)
+ mPlugin.reset(new Internal::SdiWindowPlugin);
+ return mPlugin.data();
}