Reference counting

In common with most other objects in MuPDF, fz_display_lists are reference counted. This means that once you have finished with a reference to a display list, it can safely be disposed of by calling fz_drop_display_list.


\begin{lstlisting}
/*
fz_drop_display_list: Drop a reference to a display list,...
...d fz_drop_display_list(fz_context *ctx, fz_display_list *list);
\end{lstlisting}

Should you wish to keep a new reference to a display list, you can generate one using fz_keep_display_list.


\begin{lstlisting}
/*
fz_keep_display_list: Keep a reference to a display list....
... *fz_keep_display_list(fz_context *ctx, fz_display_list *list);
\end{lstlisting}

In general, it is rare for you to want to make a new reference to a display list until write operations on one have finished. It is good form to avoid this.