You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by fa...@apache.org on 2006/10/03 11:53:12 UTC

svn commit: r452382 - /incubator/stdcxx/trunk/include/sstream.cc

Author: faridz
Date: Tue Oct  3 02:53:11 2006
New Revision: 452382

URL: http://svn.apache.org/viewvc?view=rev&rev=452382
Log:
2006-10-03 Farid Zaripov <fa...@kyiv.vdiweb.com>

	* sstream.cc (basic_stringbuf<>::str): Added check before
	deallocate the old buffer

Modified:
    incubator/stdcxx/trunk/include/sstream.cc   (contents, props changed)

Modified: incubator/stdcxx/trunk/include/sstream.cc
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/sstream.cc?view=diff&rev=452382&r1=452381&r2=452382
==============================================================================
--- incubator/stdcxx/trunk/include/sstream.cc (original)
+++ incubator/stdcxx/trunk/include/sstream.cc Tue Oct  3 02:53:11 2006
@@ -135,11 +135,13 @@
         // copy the provided string to buffer
         traits_type::copy (__buf, __s, __slen);
 
-        if (this->_C_buffer && this->_C_own_buf ())
-            __alloc.deallocate (this->_C_buffer, this->_C_bufsize);
+        if (this->_C_buffer != __buf) {
+            if (this->_C_buffer && this->_C_own_buf ())
+                __alloc.deallocate (this->_C_buffer, this->_C_bufsize);
 
-        this->_C_buffer  = __buf;
-        this->_C_bufsize = __bufsize;
+            this->_C_buffer  = __buf;
+            this->_C_bufsize = __bufsize;
+        }
     }
 
     if (this->_C_is_in ())

Propchange: incubator/stdcxx/trunk/include/sstream.cc
------------------------------------------------------------------------------
    svn:eol-style = native