work on smart pointer transition of musrWiz.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <memory>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QProcess>
|
||||
@@ -83,16 +84,18 @@ int main(int argc, char *argv[])
|
||||
|
||||
QApplication app(argc, argv);
|
||||
|
||||
PAdmin *admin = new PAdmin();
|
||||
std::unique_ptr<PAdmin> admin = std::make_unique<PAdmin>();
|
||||
if (admin == nullptr) {
|
||||
return 1;
|
||||
}
|
||||
if (!admin->IsValid()) {
|
||||
delete admin;
|
||||
return 1;
|
||||
}
|
||||
admin->dump(dump);
|
||||
|
||||
PMsrData *info = new PMsrData(); // this content will eventually be set by the xml-handler
|
||||
std::unique_ptr<PMsrData> info = std::make_unique<PMsrData>(); // this content will eventually be set by the xml-handler
|
||||
|
||||
PMusrWiz wizard(admin, info);
|
||||
PMusrWiz wizard(admin.get(), info.get());
|
||||
wizard.show();
|
||||
|
||||
app.exec();
|
||||
@@ -138,10 +141,5 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
if (info)
|
||||
delete info;
|
||||
if (admin)
|
||||
delete admin;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user