# HG changeset patch # User Konstantinos Poulios # Date 1296955468 -3600 # Node ID e8f17ad29f95e224e36a6bfb33a0740ad3a7308b # Parent aafbaea219cb3b43c122c9eed2038c13aca9acb4 Prevent race condition in update_axes_layout diff -r aafbaea219cb -r e8f17ad29f95 src/ChangeLog --- a/src/ChangeLog Sat Feb 05 13:09:24 2011 -0800 +++ b/src/ChangeLog Sun Feb 06 02:24:28 2011 +0100 @@ -1,3 +1,9 @@ +2011-02-06 Konstantinos Poulios + + * graphics.cc (updating_axes_layout): New file-scope variable. + (axes::properties::update_axes_layout): Return immediately if + updating_axes_layout is true. + 2011-02-03 John W. Eaton * octave.cc: Include and for isatty. diff -r aafbaea219cb -r e8f17ad29f95 src/graphics.cc --- a/src/graphics.cc Sat Feb 05 13:09:24 2011 -0800 +++ b/src/graphics.cc Sun Feb 06 02:24:28 2011 +0100 @@ -3899,9 +3899,14 @@ x_gl_mat2 = x_viewport * x_projection; } +static bool updating_axes_layout = false; + void axes::properties::update_axes_layout (void) { + if (updating_axes_layout) + return; + graphics_xform xform = get_transform (); double xd = (xdir_is ("normal") ? 1 : -1); @@ -3991,6 +3996,10 @@ zPlaneN = (zPlane == z_min ? z_max : z_min); fz = (z_max-z_min)/sqrt(dir(0)*dir(0)+dir(1)*dir(1)); + unwind_protect frame; + frame.protect_var (updating_axes_layout); + updating_axes_layout = true; + update_ticklengths (); xySym = (xd*yd*(xPlane-xPlaneN)*(yPlane-yPlaneN) > 0);