Reference counting

As stated before, fz_paths are reference counted objects. Once one has been created, references can be created/destroyed using the standard keep/drop conventions:


\begin{lstlisting}
/*
fz_keep_path: Take an additional reference to
a path.
\p...
...ns.
*/
void fz_drop_path(fz_context *ctx, const fz_path *path);
\end{lstlisting}

A path with more than one reference is considered to be `frozen' or `immutable'. It is not safe to modify such a path, as the other holder of a reference to it may not expect it to be being changed. That is to say that modification operations on paths are not atomic between threads.

If you have a path that you wish to be able to modify, simply call fz_clone_path to obtain a reference to a copy of the path that is safe to modify:


\begin{lstlisting}
/*
fz_clone_path: Clone the data for a path.
\par
This is us...
...ate.
*/
fz_path *fz_clone_path(fz_context *ctx, fz_path *path);
\end{lstlisting}