Commit afec5e0f authored by Locatelli's avatar Locatelli

Correct bad exit when click on the terminal cross

parent b1e121d2
......@@ -50,7 +50,7 @@ public:
NomadShell(Server& lserver) :
server(lserver) {
//_quit = false;
_quit = false;
_sim = false;
historyIter = 0;
m_Data_ready = false;
......@@ -58,6 +58,7 @@ public:
bool _sim;
bool _quit;
/*
* restore
......@@ -159,8 +160,7 @@ private:
struct termios tbufsave;
int32 historyIter;
deque<string> history;
//bool _quit;
unique_ptr<application::Instance> m_ns;
unique_ptr<application::Requester> m_requester;
......@@ -245,6 +245,10 @@ private:
while (1) {
ch = getchar();
if (_quit == true) {
buf = "exit";
ch = '\r';
}
//cout << ch << endl;
if ((ch == '\r') || (ch == '\n')) {
// End of line
......@@ -595,10 +599,13 @@ public:
application::This::setRunning();
_condition.wait(lock);
signal(SIGINT, SIG_DFL);
subscriber->cancel();
// td->interrupt();
// subscriberThread->interrupt();
signal(SIGABRT, SIG_DFL);
signal(SIGHUP, SIG_DFL);
signal(SIGSEGV, SIG_DFL);
signal(SIGPIPE, SIG_DFL);
if (_sim == false) {
signal(SIGINT, SIG_DFL);
}
clean_shutdown();
td->join();
......@@ -613,9 +620,7 @@ NomadShell* shell = NULL;
* crash_handler
*/
void crash_handler(int32 sig) {
unique_lock<mutex> lock(_conditionMutex);
_condition.notify_one();
shell->_quit = true;
}
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment