Index: code/branches/unity_build/src/libraries/util/OutputHandler.cc
===================================================================
--- code/branches/unity_build/src/libraries/util/OutputHandler.cc	(revision 8440)
+++ code/branches/unity_build/src/libraries/util/OutputHandler.cc	(revision 8515)
@@ -147,7 +147,8 @@
         OutputListener that writes all the output piece by piece to an array
         associated with the corresponding output level.
+        Used as buffer until all output devices have been initialised.
     @note
-        Only output below or equal to the current soft debug level is written
-        to minimise huge arrays for the normal run.
+        At some point, OutputHandler::disableMemoryLog() has to be called in
+        order to avoid large memory footprints of this class.
     */
     class MemoryLogWriter : public OutputListener
@@ -156,8 +157,4 @@
         friend class OutputHandler;
 
-        /**
-        @brief
-            Sets the right soft debug level and registers itself
-        */
         MemoryLogWriter()
             : OutputListener("memoryLog")
@@ -166,5 +163,5 @@
         }
 
-        //! Pushed the just written output to the internal array
+        //! Push the just written output to the internal array
         void outputChanged(int level)
         {
@@ -180,6 +177,6 @@
 
     private:
-        std::ostringstream                        buffer_; //!< Stream object used to process the output
-        std::vector<std::pair<int, std::string> > output_; //!< Vector containing ALL output
+        std::ostringstream          buffer_; //!< Stream object used to process the output
+        OutputHandler::OutputVector output_; //!< Vector containing ALL output
     };
 
@@ -212,8 +209,8 @@
         this->registerOutputListener(this->consoleWriter_);
 
-        this->output_ = new MemoryLogWriter();
-        // We capture as much input as the listener with the highest level
-        this->output_->softDebugLevel_ = getSoftDebugLevel();
-        this->registerOutputListener(this->output_);
+        this->memoryBuffer_ = new MemoryLogWriter();
+        // Write everything, e.g. use hardDebugLevel
+        this->memoryBuffer_->softDebugLevel_ = hardDebugLevel;
+        this->registerOutputListener(this->memoryBuffer_);
     }
 
@@ -223,5 +220,5 @@
         delete this->logFile_;
         delete this->consoleWriter_;
-        delete this->output_;
+        delete this->memoryBuffer_; // Might already be NULL
     }
 
@@ -267,12 +264,14 @@
     }
 
-    OutputHandler::OutputVectorIterator OutputHandler::getOutputVectorBegin() const
-    {
-        return this->output_->output_.begin();
-    }
-
-    OutputHandler::OutputVectorIterator OutputHandler::getOutputVectorEnd() const
-    {
-        return this->output_->output_.end();
+    void OutputHandler::disableMemoryLog()
+    {
+        this->unregisterOutputListener(this->memoryBuffer_);
+        // Only clear the buffer so we can still reference the vector
+        this->memoryBuffer_->output_.clear();
+    }
+
+    const OutputHandler::OutputVector& OutputHandler::getOutput() const
+    {
+        return this->memoryBuffer_->output_;
     }
 
Index: code/branches/unity_build/src/libraries/util/OutputHandler.h
===================================================================
--- code/branches/unity_build/src/libraries/util/OutputHandler.h	(revision 8440)
+++ code/branches/unity_build/src/libraries/util/OutputHandler.h	(revision 8515)
@@ -103,9 +103,7 @@
                 { return OutputHandler::getInstance().setOutputLevel(level); }
 
-            typedef std::vector<std::pair<int, std::string> >::const_iterator OutputVectorIterator;
-            //! Returns an iterator to the beginning of the all-output vector
-            OutputVectorIterator getOutputVectorBegin() const;
-            //! Returns an iterator to the end of the all-output vector
-            OutputVectorIterator getOutputVectorEnd() const;
+            typedef std::vector<std::pair<int, std::string> > OutputVector;
+            //! Returns all output written so far (empty if disableMemoryLog() was called)
+            const OutputVector& getOutput() const;
 
             //! Writes to all output devices
@@ -140,4 +138,6 @@
             //! Enables the std::cout stream for output (startup behaviour)
             void enableCout();
+            //! Stop writing to the memory buffer (call this as soon as possible to minimise memory usage)
+            void disableMemoryLog();
 
             //! Sets the level of the incoming output and returns the OutputHandler
@@ -225,5 +225,5 @@
             LogFileWriter*             logFile_;          //!< Listener that writes to the log file
             ConsoleWriter*             consoleWriter_;    //!< Listener for std::cout (just program beginning)
-            MemoryLogWriter*           output_;           //!< Listener that Stores ALL output below the current soft debug level
+            MemoryLogWriter*           memoryBuffer_;     //!< Writes to memory as a buffer (can/must be stopped at some time)
             static int                 softDebugLevel_s;  //!< Maximum of all soft debug levels. @note This is only static for faster access
     };
