]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix wxScopedCharTypeBuffer<T>::CreateOwned() to match docs.
authorVáclav Slavík <vslavik@fastmail.fm>
Wed, 5 May 2010 07:45:33 +0000 (07:45 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Wed, 5 May 2010 07:45:33 +0000 (07:45 +0000)
The documentation says that it takes ownership of the memory block
passed to it, but the implementation made a copy.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64209 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/buffer.h
interface/wx/buffer.h

index 574d0df0734f10abf23767c93be21b1d7fc48935..4c5c27eede9c6d9447b5d833644a9b5ee52e31c0 100644 (file)
@@ -95,7 +95,7 @@ public:
     // Creates "owned" buffer, i.e. takes over ownership of 'str' and frees it
     // in dtor (if ref.count reaches 0).
     static
-    const wxScopedCharTypeBuffer CreateOwned(const CharType *str,
+    const wxScopedCharTypeBuffer CreateOwned(CharType *str,
                                              size_t len = wxNO_LEN )
     {
         if ( len == wxNO_LEN )
@@ -103,7 +103,7 @@ public:
 
         wxScopedCharTypeBuffer buf;
         if ( str )
-            buf.m_data = new Data(StrCopy(str, len), len);
+            buf.m_data = new Data(str, len);
         return buf;
     }
 
index b6052f47d92118b792a8cbd5517c0172d429c03b..d9a61010dcc7e62b7dc7ecdadc2b4c0df5c250f5 100644 (file)
@@ -74,7 +74,7 @@ public:
         @param len If specified, length of the string, otherwise the string
                    is considered to be NUL-terminated.
      */
-    static const wxScopedCharTypeBuffer CreateOwned(const CharType *str, size_t len = wxNO_LEN);
+    static const wxScopedCharTypeBuffer CreateOwned(CharType *str, size_t len = wxNO_LEN);
 
     /**
         Copy constructor.