[cairo] cairomm: Path destruction

Murray Cumming murrayc at murrayc.com
Tue May 9 00:50:33 PDT 2006


On Mon, 2006-05-08 at 23:47 -0500, Jonathon Jongsma wrote:
> On 5/8/06, Rick L Vinyard Jr <rvinyard at cs.nmsu.edu> wrote:
> > On Sun, 2006-05-07 at 23:20 -0500, Jonathon Jongsma wrote:
> > > That's definitely the simplest solution.  But I have to admit that
> > > returning a bare pointer to a heap-allocated object leaves a bit of a
> > > bad taste in my mouth, especially since there are tools available in
> > > C++ (e.g. smart pointers) to significantly reduce the risk of memory
> > > leaks in user code.
> >
> > I suppose that what I find most troubling is that it seems to break from
> > the style of your other *mm libraries which predominantly use RefPtr's
> > for heap allocations.

In gtkmm, we generally return these little struct instances by value.
But I don't think there is a cairo_path_copy(), needed to implement a
copy constructor and operator=().

-- 
Murray Cumming
murrayc at murrayc.com
www.murrayc.com
www.openismus.com



More information about the cairo mailing list