@@ -70,6 +70,16 @@ public:
|
|||||||
bool forceProcess;
|
bool forceProcess;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class protector final {
|
||||||
|
private:
|
||||||
|
basic_variables *_var = nullptr;
|
||||||
|
|
||||||
|
public:
|
||||||
|
~protector();
|
||||||
|
|
||||||
|
void setVariablePtr(basic_variables *&_var);
|
||||||
|
};
|
||||||
|
|
||||||
using FunctionBase = basic_function;
|
using FunctionBase = basic_function;
|
||||||
using FunctionManager = basic_function_manager;
|
using FunctionManager = basic_function_manager;
|
||||||
using VariableTable = basic_variables;
|
using VariableTable = basic_variables;
|
||||||
|
|||||||
@@ -25,18 +25,15 @@
|
|||||||
|
|
||||||
namespace PartitionManager {
|
namespace PartitionManager {
|
||||||
|
|
||||||
__attribute__((constructor))
|
__attribute__((constructor)) void init() {
|
||||||
void init() {
|
|
||||||
Helper::LoggingProperties::setLogFile("/sdcard/Documents/last_pmt_logs.log");
|
Helper::LoggingProperties::setLogFile("/sdcard/Documents/last_pmt_logs.log");
|
||||||
}
|
}
|
||||||
|
|
||||||
__attribute__((destructor))
|
|
||||||
void cleanup() {
|
|
||||||
delete Variables;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto Variables = new VariableTable();
|
auto Variables = new VariableTable();
|
||||||
|
|
||||||
|
void protector::setVariablePtr(basic_variables *&_var) { this->_var = _var; }
|
||||||
|
protector::~protector() { delete _var; }
|
||||||
|
|
||||||
basic_variables::~basic_variables() { delete PartMap; }
|
basic_variables::~basic_variables() { delete PartMap; }
|
||||||
basic_variables::basic_variables()
|
basic_variables::basic_variables()
|
||||||
: logFile(Helper::LoggingProperties::FILE), onLogical(false),
|
: logFile(Helper::LoggingProperties::FILE), onLogical(false),
|
||||||
@@ -52,6 +49,8 @@ int Main(int argc, char **argv) {
|
|||||||
try {
|
try {
|
||||||
// try-catch start
|
// try-catch start
|
||||||
CLI::App AppMain{"Partition Manager Tool"};
|
CLI::App AppMain{"Partition Manager Tool"};
|
||||||
|
protector prot;
|
||||||
|
prot.setVariablePtr(Variables);
|
||||||
FunctionManager FuncManager;
|
FunctionManager FuncManager;
|
||||||
|
|
||||||
AppMain.fallthrough(true);
|
AppMain.fallthrough(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user