OK this does it. Can someone please close both bugs 1038594 and 1196143 with this patch? I'd do it myself if you gave me permission.
And please also close bug 1226096. Thanks!
ralf
Explanation: the LGradient renderer, on its setup, gets a copy of gr->color but that isn't updated when gr->color is freed on redraw. We now check for that before rendering. Also the order of nulling+freeing is reversed to make sure there is no race condition (not sure if necessary but hey).
--- inkscape-20050701-2000/src/sp-gradient.cpp 2005-07-02 05:00:25.000000000 +0200 +++ inkscape-patched/src/sp-gradient.cpp 2005-07-02 12:00:23.999286048 +0200 @@ -774,9 +774,10 @@ { bool ret = false;
- if (gr->color) { - g_free(gr->color); + if (gr->color != NULL) { + void* tmp = gr->color; gr->color = NULL; + g_free(tmp); ret = true; }
@@ -1354,6 +1360,12 @@ { SPLGPainter *lgp = (SPLGPainter *) painter;
+ if (lgp->lg->color == NULL) + { + sp_gradient_ensure_colors (lgp->lg); + lgp->lgr.vector = lgp->lg->color; + } + nr_render((NRRenderer *) &lgp->lgr, pb, NULL); }