start replacing raw to smart pointers for mupp.
This commit is contained in:
@@ -49,31 +49,14 @@
|
||||
PmuppScript::PmuppScript(QStringList script) :
|
||||
fScript(script)
|
||||
{
|
||||
fParamDataHandler = 0;
|
||||
fLoadPath = QString("./");
|
||||
fSavePath = QString("./");
|
||||
fSelected = -2; // nothing selected
|
||||
fNorm = false;
|
||||
|
||||
fAdmin = new PmuppAdmin();
|
||||
fAdmin = std::make_unique<PmuppAdmin>();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief PmuppScript::~PmuppScript. Dtor
|
||||
*/
|
||||
PmuppScript::~PmuppScript()
|
||||
{
|
||||
if (fParamDataHandler) {
|
||||
delete fParamDataHandler;
|
||||
fParamDataHandler = 0;
|
||||
}
|
||||
|
||||
if (fAdmin) {
|
||||
delete fAdmin;
|
||||
fAdmin = 0;
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief PmuppScript::executeScript. Handles the script commands.
|
||||
@@ -81,8 +64,8 @@ PmuppScript::~PmuppScript()
|
||||
*/
|
||||
int PmuppScript::executeScript()
|
||||
{
|
||||
fParamDataHandler = new PParamDataHandler();
|
||||
if (fParamDataHandler == 0) {
|
||||
fParamDataHandler = std::make_unique<PParamDataHandler>();
|
||||
if (fParamDataHandler == nullptr) {
|
||||
std::cerr << std::endl << "**ERROR** couldn't invoke data handler ..." << std::endl << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user