* @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.
*
Factory::Factory()
: Plugins::iPluginFactory()
- , mPlugin(0)
{
setObjectName(QString("%1-Factory").arg(VER_MODULE_NAME_STR));
Factory::~Factory()
{
- if (mPlugin)
- delete mPlugin;
+ mPlugin.reset();
EVAF_INFO("%s destroyed", qPrintable(objectName()));
}
{
Q_UNUSED(name);
- if (mPlugin == 0)
- mPlugin = new Internal::SdiWindowPlugin;
- return mPlugin;
+ if (!mPlugin)
+ mPlugin.reset(new Internal::SdiWindowPlugin);
+ return mPlugin.data();
}