From 4a34c928e5673e950385f588d4283265bb18bad0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 23 Oct 2014 13:56:04 +0000 Subject: [PATCH] Document wxScopedCharTypeBuffer::release(). Although this method is dangerous, it still (or, maybe, especially) needs to be documented. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78055 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- interface/wx/buffer.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/interface/wx/buffer.h b/interface/wx/buffer.h index 8ab9dce8aa..e24089999f 100644 --- a/interface/wx/buffer.h +++ b/interface/wx/buffer.h @@ -92,6 +92,20 @@ public: */ ~wxScopedCharTypeBuffer(); + /** + Returns the internal pointer and resets the buffer. + + It's the caller responsibility to deallocate the returned pointer using + @c free() function. + + Notice that this method is dangerous because it can only be called on a + non-shared owning buffer. Calling it on any other kind of buffer object + will result in a crash after the pointer is freed, so avoid using it + unless absolutely necessary and you are absolutely certain that the + buffer is not shared. + */ + CharType* release() const; + /// Resets the buffer to NULL, freeing the data if necessary. void reset();