summaryrefslogtreecommitdiff
path: root/lib/Main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Main.cc')
-rw-r--r--lib/Main.cc13
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/Main.cc b/lib/Main.cc
index 653adea..5571689 100644
--- a/lib/Main.cc
+++ b/lib/Main.cc
@@ -8,8 +8,6 @@ Main::Main() : setted(false) {}
Main::~Main() {}
-extern Main * Application;
-
void Main::set_args(int a_argc, char ** a_argv, char ** a_enve) {
if (setted) {
return;
@@ -20,7 +18,7 @@ void Main::set_args(int a_argc, char ** a_argv, char ** a_enve) {
setted = true;
}
-int main(int argc, char ** argv, char ** enve) {
+int Main::truemain(Main * Application, int argc, char ** argv, char ** enve) {
int r;
try {
@@ -32,14 +30,11 @@ int main(int argc, char ** argv, char ** enve) {
}
catch (GeneralException e) {
Base::printm(M_ERROR, "The application caused an exception: %s\n", e.GetMsg());
- delete Application;
- exit(-1);
+ return -1;
}
catch (...) {
Base::printm(M_ERROR, "The application caused an unknow exception\n");
- delete Application;
- exit(-1);
+ return -1;
}
- delete Application;
- exit(r);
+ return r;
}