[Cairo] Re: Semantics of cairo_copy changed in 0.1.7

Keith Packard keithp at keithp.com
Tue Sep 30 12:23:38 PDT 2003


Around 15 o'clock on Sep 30, Carl Worth wrote:

> I've gone ahead and committed this (0.1.7).

I looked at that patch and am confused:

    *dest = *src;
    dest->ref_count = 0;

    dest->gstate = _cairo_gstate_clone (src->gstate);

Is the intent to *push* src->gstate onto the dest gstate stack?  Or is the
intent to *discard* the existing gstate stack and replace it with (a copy
of) the top of the src gstate stack?  It doesn't do either of these.

    *dest = *src 

seems like a bad idea; pointers inside dest must be handled separately, and
even non-pointer data probably needs some careful thought (dest->status
should probably not get smashed and drop error information).

Also, this API should check src->status and dest->status to avoid 
dereferencing null gstate values.

-keith






More information about the cairo mailing list