client server connection improved, interrupt handler for monitor process added
[u/mrichter/AliRoot.git] / MONITOR / AliMonitorControl.cxx
index 83c803d81f2300bec26e07b503b8d56a6484e138..2fdf7cac112661e74f9503c4e8e105f7c2432e3a 100644 (file)
@@ -35,6 +35,7 @@
 #include <TGLabel.h>
 #include <TGTextEntry.h>
 #include <TTimer.h>
+#include <TApplication.h>
 #include "AliMonitorProcess.h"
 
 
@@ -369,7 +370,10 @@ void AliMonitorControl::HandleMenu(Int_t id)
                 kMBIconQuestion, kMBYes | kMBNo, &result);
     if (result == kMBYes) {
       fMenuFile->EnableEntry(kMenuFileAbort);
-      if (fMonitorProcess->IsStopped()) exit(0);
+      if (fMonitorProcess->IsStopped()) {
+       delete fMonitorProcess;
+       gApplication->Terminate(0);
+      }
       fMonitorProcess->Stop();
       fTerminating = kTRUE;
     }
@@ -456,7 +460,10 @@ Bool_t AliMonitorControl::HandleTimer(TTimer* timer)
 // update the displayed information
 
   timer->TurnOff();
-  if (fTerminating && fMonitorProcess->IsStopped()) exit(0); 
+  if (fTerminating && fMonitorProcess->IsStopped()) {
+    delete fMonitorProcess;
+    gApplication->Terminate(0);
+  }
   UpdateStatus();
   gSystem->ProcessEvents();
   timer->TurnOn();