[mapserver-commits] r11673 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Wed May 11 12:33:28 EDT 2011
Author: tbonfort
Date: 2011-05-11 09:33:28 -0700 (Wed, 11 May 2011)
New Revision: 11673
Modified:
trunk/mapserver/HISTORY.TXT
trunk/mapserver/maplegend.c
Log:
apply fix for #3834 on legend icon rendering
Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT 2011-05-11 09:01:34 UTC (rev 11672)
+++ trunk/mapserver/HISTORY.TXT 2011-05-11 16:33:28 UTC (rev 11673)
@@ -26,6 +26,8 @@
Version 6.0.0-rc2 (2011-05-05)
------------------------------
+- apply fix for #3834 on legend icon rendering
+
- Fixed seg fault with [shpxy] tag... (#3860)
- Removed obsolete msQueryByOperator() function
Modified: trunk/mapserver/maplegend.c
===================================================================
--- trunk/mapserver/maplegend.c 2011-05-11 09:01:34 UTC (rev 11672)
+++ trunk/mapserver/maplegend.c 2011-05-11 16:33:28 UTC (rev 11673)
@@ -73,11 +73,9 @@
else {
renderer = MS_IMAGE_RENDERER(image_draw);
if (lp->opacity > 0 && lp->opacity < 100) {
- if (!renderer->supports_transparent_layers) {
- msApplyOutputFormat(&transFormat, image->format, MS_TRUE,
- MS_NOOVERRIDE,MS_NOOVERRIDE);
+ if (!renderer->supports_transparent_layers) {
image_draw = msImageCreate(image->width, image->height,
- transFormat, image->imagepath, image->imageurl, map->resolution, map->defresolution, NULL);
+ image->format, image->imagepath, image->imageurl, map->resolution, map->defresolution, NULL);
if (!image_draw) {
msSetError(MS_MISCERR, "Unable to initialize temporary transparent image.",
"msDrawLegendIcon()");
@@ -250,6 +248,21 @@
altrenderer->getRasterBufferHandle(image_draw,&rb);
renderer->mergeRasterBuffer(image,&rb,lp->opacity*0.01,0,0,0,0,rb.width,rb.height);
+ /*
+ * hack to work around bug #3834: if we have use an alternate renderer, the symbolset may contain
+ * symbols that reference it. We want to remove those references before the altFormat is destroyed
+ * to avoid a segfault and/or a leak, and so the the main renderer doesn't pick the cache up thinking
+ * it's for him.
+ */
+ for(i=0; i<map->symbolset.numsymbols; i++) {
+ if (map->symbolset.symbol[i]!=NULL) {
+ symbolObj *s = map->symbolset.symbol[i];
+ if(s->renderer == altrenderer) {
+ altrenderer->freeSymbol(s);
+ s->renderer = NULL;
+ }
+ }
+ }
msFreeImage(image_draw);
}
More information about the mapserver-commits
mailing list