[mapguide][MG459][New] Fix for 860954

Reva Revadigar reva.revadigar at autodesk.com
Wed Nov 29 14:03:50 EST 2006


You can view the artifact detail at the following URL:

    https://mapguide.osgeo.org/servlets/Scarab/id/MG459

Type
 Defect

Artifact ID
 MG459 (Fix for 860954)

Reported by
 Reva Revadigar
 revadir (reva.revadigar at autodesk.com)

New artifact details:
---------------------------------------------------------

- Version set to new value
  1.0.2
- Submission Reviewed set to new value
  Yes
- Summary set to new value
  Fix for 860954
- Operating system set to new value
  All
- Artifact created
- Component set to new value
  Server
- Priority set to new value
  P3
- Platform set to new value
  All
- Steps to Reproduce set to new value
  1. Launch Map
2. Load a layer by drag/drop of a .layer file pointing to a polygon layer.
3. Edit style of layer by adding a theme with default properties.

Result:
Boundschecker reports 33 leaks of 32 bytes each (sizeof a MdfString) at source location:

LengthConverter::UnitToEnglish - [lengthconverter.cpp, line 138 (MgMdfModeld.dll)]

The function LengthConverter::UnitToEnglish() is allocating memory for an MdfString and returning a pointer to the newly created string.  Callers must free this string.  Right now they are not doing this.
- Defect Severity set to new value
  Low
- Artifact Status set to new value
  New
- Resolution set to new value
  Submitted
- Target milestone set to new value
  1.1.0
- Subcomponent set to new value
  Core
- Description set to new value
  I'm fixing memory leaks in Map and I came across some memory leaks in the GisPlatform code, which is shared between Map and MapGuide.  What I found was that callers to LengthConverter::UnitToEnglish() need to free the returned string.  That method is in MdfModel.dll, but it is being called from two places in MdfParser.dll.  So I need to modify IOStroke.cpp and IOSymbol.cpp.  I need to make the following changes:
 
IoStroke.cpp:
 
98c98,99
<     fd << EncodeString(*LengthConverter::UnitToEnglish(stroke->GetUnit()));
---
>     std::auto_ptr<MdfString> str(LengthConverter::UnitToEnglish(stroke->GetUnit()));
>     fd << EncodeString(*str);
 
IoSymbol.cpp:
 
<     fd << EncodeString(*LengthConverter::UnitToEnglish(m_symbol->GetUnit()));
---
>     std::auto_ptr<MdfString> str(LengthConverter::UnitToEnglish(m_symbol->GetUnit()));
>     fd << EncodeString(*str);


---------------------------------------------------------
This message was automatically generated by Project Tracker.








More information about the Mapguide_issues mailing list