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