summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/Main.h11
-rw-r--r--src/Main.cc8
2 files changed, 7 insertions, 12 deletions
diff --git a/includes/Main.h b/includes/Main.h
index 60de081..49afd35 100644
--- a/includes/Main.h
+++ b/includes/Main.h
@@ -15,13 +15,16 @@ class Exit : public GeneralException {
class MainTask : public Task {
public:
- MainTask() : m_stopTaskManOnExit(true) { }
+ MainTask(int argc, char ** argv, char ** enve) : argc(argc), argv(argv), enve(enve) { }
virtual ~MainTask();
virtual const char * getName() const;
virtual void Do();
void stopTaskManOnExit(bool v) { m_stopTaskManOnExit = v; }
private:
- bool m_stopTaskManOnExit;
+ int argc;
+ char ** argv;
+ char ** enve;
+ bool m_stopTaskManOnExit = true;
};
class Main {
@@ -37,10 +40,6 @@ class Main {
static Status getStatus() { return s_application->m_status; }
int bootstrap(int _argc, char ** _argv);
static bool hasMain() { return s_application; }
- protected:
- int argc;
- char ** argv;
- char ** enve;
private:
Status m_status;
static Main * s_application;
diff --git a/src/Main.cc b/src/Main.cc
index 32b7cf8..baf55d4 100644
--- a/src/Main.cc
+++ b/src/Main.cc
@@ -47,20 +47,16 @@ const char * Balau::MainTask::getName() const {
return "Main Task";
}
-int Balau::Main::bootstrap(int _argc, char ** _argv) {
+int Balau::Main::bootstrap(int argc, char ** argv) {
int r = 0;
m_status = STARTING;
- argc = _argc;
- argv = _argv;
- enve = NULL;
-
for (AtStart * ptr = AtStart::s_head; ptr; ptr = ptr->m_next)
ptr->doStart();
try {
m_status = RUNNING;
- TaskMan::registerTask(new MainTask());
+ TaskMan::registerTask(new MainTask(argc, argv, NULL));
r = TaskMan::getDefaultTaskMan()->mainLoop();
m_status = STOPPING;
}