[mapguide-commits] r6536 - trunk/MgDev/Server/src/Services/Mapping
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Thu Mar 8 21:34:00 EST 2012
Author: liuar
Date: 2012-03-08 18:34:00 -0800 (Thu, 08 Mar 2012)
New Revision: 6536
Modified:
trunk/MgDev/Server/src/Services/Mapping/MappingUtil.cpp
Log:
Submit on behalf of Mars Wu
Fix Ticket: http://trac.osgeo.org/mapguide/ticket/1961
Following line is executed in StylizeLayers?() function:
STRING layerWkt = layerCs->ToString();
layerCs will be NULL if there is no CS or CS override specified for the feature source. Then NULL pointer exception will happen in above line. On Windows, there is a macro MG_CATCH_AND_RELEASE() to catch this exception and simply continue the logic.
#define MG_CATCH_AND_RELEASE() \
} \
catch (MgException* e) \
{ \
mgException = e; \
} \
catch (...) \
{ \
}
However, on Linux, NULL pointer will lead to Segmentation Fault, which cannot be caught by catch (...) and will crash the application directly. So the pointer has to be verified before calling any methods of the pointer to avoid Segmentation Fault crash on Linux
Modified: trunk/MgDev/Server/src/Services/Mapping/MappingUtil.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Mapping/MappingUtil.cpp 2012-03-09 02:21:17 UTC (rev 6535)
+++ trunk/MgDev/Server/src/Services/Mapping/MappingUtil.cpp 2012-03-09 02:34:00 UTC (rev 6536)
@@ -660,7 +660,7 @@
// On error, ignore the exception and use the original extent.
MG_TRY()
Ptr<MgSpatialContextReader> contextReader = svcFeature->GetSpatialContexts(featResId, false);
- STRING layerWkt = layerCs->ToString();
+ STRING layerWkt = (NULL == layerCs.p) ? L"" : layerCs->ToString();
while (contextReader.p != NULL && contextReader->ReadNext())
{
// Try to find wkt for feature's coordinate system
Property changes on: trunk/MgDev/Server/src/Services/Mapping/MappingUtil.cpp
___________________________________________________________________
Added: svn:mergeinfo
+ /sandbox/adsk/2.4j/Server/src/Services/Mapping/MappingUtil.cpp:6327-6535
/sandbox/rfc94/Server/src/Services/Mapping/MappingUtil.cpp:5099-5163
/trunk/MgDev/Server/src/Services/Mapping/MappingUtil.cpp:6250-6326
More information about the mapguide-commits
mailing list