[Orxonox-commit 1632] r6350 - code/branches/presentation2/src/libraries/core

rgrieder at orxonox.net rgrieder at orxonox.net
Mon Dec 14 01:03:27 CET 2009


Author: rgrieder
Date: 2009-12-14 01:03:27 +0100 (Mon, 14 Dec 2009)
New Revision: 6350

Modified:
   code/branches/presentation2/src/libraries/core/IOConsole.cc
Log:
IOConsole should not process input during destruction.

Modified: code/branches/presentation2/src/libraries/core/IOConsole.cc
===================================================================
--- code/branches/presentation2/src/libraries/core/IOConsole.cc	2009-12-13 23:51:34 UTC (rev 6349)
+++ code/branches/presentation2/src/libraries/core/IOConsole.cc	2009-12-14 00:03:27 UTC (rev 6350)
@@ -120,8 +120,10 @@
 
     IOConsole::~IOConsole()
     {
-        // Empty all buffers
-        this->preUpdate(Game::getInstance().getGameClock());
+        // Process output written to std::cout in the meantime
+        std::cout.flush();
+        if (!this->origCout_.str().empty())
+            this->shell_->addOutputLine(this->origCout_.str(), Shell::None);
         // Erase input and status lines
         this->cout_ << "\033[1G\033[J";
         // Move cursor to the bottom
@@ -503,9 +505,12 @@
     //! Resets std::cout redirection and restores the terminal mode
     IOConsole::~IOConsole()
     {
+        // Process output written to std::cout in the meantime
+        std::cout.flush();
+        if (!this->origCout_.str().empty())
+            this->shell_->addOutputLine(this->origCout_.str(), Shell::None);
+
         this->shell_->unregisterListener(this);
-        // Empty all buffers
-        this->preUpdate(Game::getInstance().getGameClock());
 
         // Erase input and status lines
         COORD pos = {0, this->inputLineRow_};
@@ -593,6 +598,7 @@
         }
 
         // Process output written to std::cout
+        std::cout.flush();
         if (!this->origCout_.str().empty())
         {
             this->shell_->addOutputLine(this->origCout_.str(), Shell::None);




More information about the Orxonox-commit mailing list