25.4 Cloning

As stated before, fz_text objects are referenced counted. Changes or manipulations cannot safely be carried out on an object which might be shared with someone else, so we provide a mechanism to clone an object. Once cloned an object is guaranteed to be safe to modify.

/* 
   fz_clone_text: Clone a text object. 
 
   text: The text object to clone. 
 
   Throws an exception on allocation failure. 
*/ 
fz_text *fz_clone_text(fz_context *ctx, const fz_text *text);