[glibmm] Gio::OutputStream: write_async(), write_all_async(): Improve docs.



commit 4bb628eb3e1b5f734dfd1a5cd0098326ccd925c6
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Mar 3 10:01:13 2015 +0100

    Gio::OutputStream: write_async(), write_all_async(): Improve docs.
    
    Add the warning about the buffer needing to stay valid because it
    is not copied, adding to the C API here:
    https://git.gnome.org/browse/glib/commit/gio/goutputstream.c?id=0f800cd1a863bc0c3e51c03592e2fb1ffbda8982

 gio/src/outputstream.hg |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/gio/src/outputstream.hg b/gio/src/outputstream.hg
index 25c191a..b318d3b 100644
--- a/gio/src/outputstream.hg
+++ b/gio/src/outputstream.hg
@@ -256,6 +256,11 @@ public:
    * For the synchronous, blocking version of this function, see
    * write().
    *
+   * Note that no copy of @a buffer will be made, so it must stay valid
+   * until @a slot is called. See write_bytes_async()
+   * for a Glib::Bytes version that will automatically hold a reference to
+   * the contents (without copying) for the duration of the call.
+   *
    * @param buffer The buffer containing the data to write.
    * @param count The number of bytes to write
    * @param slot Callback slot to call when the request is satisfied.
@@ -290,6 +295,11 @@ public:
    *
    * For the synchronous, blocking version of this function, see
    * write().
+
+   * Note that no copy of @a buffer will be made, so it must stay valid
+   * until @a slot is called. See write_bytes_async()
+   * for a Glib::Bytes version that will automatically hold a reference to
+   * the contents (without copying) for the duration of the call.
    *
    * @param buffer The buffer containing the data to write.
    * @param count The number of bytes to write
@@ -333,6 +343,9 @@ public:
    * For the synchronous, blocking version of this function, see
    * write().
    *
+   * Note that no copy of @a buffer will be made, so it must stay valid
+   * until @a slot is called.
+   *
    * @param buffer The buffer containing the data to write.
    * @param count The number of bytes to write
    * @param slot Callback slot to call when the request is satisfied.
@@ -370,6 +383,9 @@ public:
    * For the synchronous, blocking version of this function, see
    * write().
    *
+   * Note that no copy of @a buffer will be made, so it must stay valid
+   * until @a slot is called.
+   *
    * @param buffer The buffer containing the data to write.
    * @param count The number of bytes to write
    * @param slot Callback slot to call when the request is satisfied.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]