From 712eef4ff9945ebdda4c735c1359ce64a3c278a0 Mon Sep 17 00:00:00 2001 From: Rene Milk <rene.milk@uni-muenster.de> Date: Tue, 2 Mar 2010 15:25:17 +0100 Subject: [PATCH] more cleanup --- stuff/logging.hh | 12 ++++++++---- stuff/misc.hh | 16 ---------------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/stuff/logging.hh b/stuff/logging.hh index 3f6f80f18..2ed5377bf 100644 --- a/stuff/logging.hh +++ b/stuff/logging.hh @@ -235,7 +235,8 @@ protected: { IdVecCIter it = streamIDs_.end(); for (; it != streamIDs_.begin(); --it) { - Stuff::safe_delete(streammap_[*it]); + delete streammap_[*it]; + streammap_[*it] = 0; } if ((logflags_ & LOG_FILE) != 0) { @@ -248,7 +249,8 @@ protected: // delete the MatlabLogStream matlabLogStreamPtr->Flush(); matlabLogFile_.close(); - Stuff::safe_delete(matlabLogStreamPtr); + delete matlabLogStreamPtr; + matlabLogStreamPtr = 0; } public: @@ -293,7 +295,8 @@ public: /// begin dtor IdVecCIter it = streamIDs_.end(); for (; it != streamIDs_.begin(); --it) { - Stuff::safe_delete(streammap_[*it]); + delete streammap_[*it]; + streammap_[*it] = 0; } if ((logflags_ & LOG_FILE) != 0) { @@ -306,7 +309,8 @@ public: // delete the MatlabLogStream matlabLogStreamPtr->Flush(); matlabLogFile_.close(); - Stuff::safe_delete(matlabLogStreamPtr); + delete matlabLogStreamPtr; + matlabLogStreamPtr = 0; /// end dtor Create(logflags_, prefix); diff --git a/stuff/misc.hh b/stuff/misc.hh index 661eeea5e..0b4f4fbf0 100644 --- a/stuff/misc.hh +++ b/stuff/misc.hh @@ -576,22 +576,6 @@ public: } }; - -/** - * \brief Only free mem pointed to by valid pointer, log warning otherwise - * - **/ - -template <class T> -void safe_delete(T t) // this is actually bullshit :P -{ - if (t) { - delete t; - t = 0; - } - // else log warning -} - template <class Container, class Element> int getIdx(const Container& ct, Element e) { -- GitLab