[mapguide-internals] Some code fixes for RFC 60
walt.welton-lair at autodesk.com
Fri May 8 02:23:37 EDT 2009
* Change your GetResourceServiceForMapDef method in ServerTileService to simply return an MgResourceService* (properly addref'ed) and not a smart-pointer. We don't have any methods which return smart-pointers. It's up to the calling code to decide if it wants to wrap the method's return value in a smart-pointer.
* In MapLayer/Map.cpp you have numerous memory leaks. You allocate a new STRCOLORLIST (assigning it to the m_colorPalette member variable), but don't delete it anywhere. Instead you only call clear on the list, which isn't the same as deleting the object. SetColorPalette also leaks any previously allocated m_colorPalette. I would simply change m_colorPalette to be a STRCOLORLIST instead of a PSTRCOLORLIST. GetColorPalette then returns the address of m_colorPalette, and SetColorPalette replaces the contents of m_colorPalette with the supplied palette.
W E @__ __o
A T R @___ _ \<,_
L @_ (*)/ (*)
More information about the mapguide-internals