[xiph-commits] r14810 - trunk/ogg/doc/libogg

giles at svn.xiph.org giles at svn.xiph.org
Sun Apr 27 20:27:06 PDT 2008


Author: giles
Date: 2008-04-27 20:27:06 -0700 (Sun, 27 Apr 2008)
New Revision: 14810

Modified:
   trunk/ogg/doc/libogg/ogg_stream_destroy.html
   trunk/ogg/doc/libogg/ogg_sync_destroy.html
Log:
Clarify that the _destroy() methods call _ogg_free() on their arguments
even though there's no explicit constructor.


Modified: trunk/ogg/doc/libogg/ogg_stream_destroy.html
===================================================================
--- trunk/ogg/doc/libogg/ogg_stream_destroy.html	2008-04-28 02:52:32 UTC (rev 14809)
+++ trunk/ogg/doc/libogg/ogg_stream_destroy.html	2008-04-28 03:27:06 UTC (rev 14810)
@@ -18,7 +18,14 @@
 <p><i>declared in "ogg/ogg.h";</i></p>
 
 <p>This function frees the memory used by the <a href="ogg_stream_state.html">ogg_stream_state</a> struct.
-<p>This should be called when you are done working with an ogg stream.  It can also be called to make sure that the struct does not exist.
+
+<p>This should be called when you are done working with an ogg stream.
+It can also be called to make sure that the struct does not exist.</p>
+
+<p>It calls free() on its argument, so if the ogg_stream_state 
+is not malloc()'d or will otherwise be freed by your own code, use 
+<a href="ogg_stream_clear.html">ogg_stream_clear</a> instead.</p>
+
 <br><br>
 <table border=0 color=black cellspacing=0 cellpadding=7>
 <tr bgcolor=#cccccc>

Modified: trunk/ogg/doc/libogg/ogg_sync_destroy.html
===================================================================
--- trunk/ogg/doc/libogg/ogg_sync_destroy.html	2008-04-28 02:52:32 UTC (rev 14809)
+++ trunk/ogg/doc/libogg/ogg_sync_destroy.html	2008-04-28 03:27:06 UTC (rev 14810)
@@ -17,8 +17,14 @@
 
 <p><i>declared in "ogg/ogg.h";</i></p>
 
-<p>This function is used to destroy an <a href="ogg_sync_state.html">ogg_sync_state</a> struct and free all memory used.
+<p>This function is used to destroy an <a href="ogg_sync_state.html">ogg_sync_state</a> struct and free all memory used.</p>
 
+<p>Note this calls free() on its argument so you should only use this 
+function if you've allocated the ogg_sync_state on the heap. If it is 
+allocated on the stack, or it will otherwise be freed by your 
+own code, use <a href="ogg_sync_clear.html">ogg_sync_clear</a> instead
+to release just the internal memory.</p>
+
 <br><br>
 <table border=0 color=black cellspacing=0 cellpadding=7>
 <tr bgcolor=#cccccc>



More information about the commits mailing list