# HG changeset patch # User John W. Eaton # Date 1215615569 14400 # Node ID 1fddd9b8e8628e20954772c921e0c6f51b1007ab # Parent 8018e10d2b8774eead9fe90f96e714f29c67de17 Fix nil_rep reference counting in gl-render.cc::vertex_data internal class diff -r 8018e10d2b87 -r 1fddd9b8e862 src/ChangeLog --- a/src/ChangeLog Wed Jul 09 10:58:12 2008 -0400 +++ b/src/ChangeLog Wed Jul 09 10:59:29 2008 -0400 @@ -1,3 +1,9 @@ +2008-07-09 Michael Goffioul + + * gl-render.cc (vertex_data::vertex_data_rep::vertex_data(void), + vertex_data::vertex_data(void), vertex_data::vertex_data(...)): + initialize reference counting correctly. + 2008-07-09 John W. Eaton * toplev.cc (main_loop): Unwind-protect global_command. diff -r 8018e10d2b87 -r 1fddd9b8e862 src/gl-render.cc --- a/src/gl-render.cc Wed Jul 09 10:58:12 2008 -0400 +++ b/src/gl-render.cc Wed Jul 09 10:59:29 2008 -0400 @@ -326,7 +326,7 @@ // reference counter int count; - vertex_data_rep (void) { } + vertex_data_rep (void) : count (1) { } vertex_data_rep (const Matrix& c, const Matrix& col, const Matrix& n, double a, float as, float ds, float ss, float se) @@ -346,7 +346,8 @@ } public: - vertex_data (void) : rep (nil_rep ()) { } + vertex_data (void) : rep (nil_rep ()) + { rep->count++; } vertex_data (const vertex_data& v) : rep (v.rep) { rep->count++; } @@ -354,9 +355,7 @@ vertex_data (const Matrix& c, const Matrix& col, const Matrix& n, double a, float as, float ds, float ss, float se) : rep (new vertex_data_rep (c, col, n, a, as, ds, ss, se)) - { - rep->count++; - } + { } vertex_data (vertex_data_rep *new_rep) : rep (new_rep) { }