[Mapguide-trac] [mapguide-trac] #2825: Memory leaks in GwsQueryEngine
MapGuide Open Source
trac_mapguide at osgeo.org
Thu Sep 17 03:13:21 PDT 2020
#2825: Memory leaks in GwsQueryEngine
-----------------------+----------------------
Reporter: jng | Owner: jng
Type: defect | Status: assigned
Priority: low | Milestone: 4.0
Component: Server | Version:
Severity: trivial | Keywords:
External ID: |
-----------------------+----------------------
From mapguide-users:
{{{
Hi all!
FdoFilter * IGWSQueryDefinition::Filter()
function returns "FdoFilter *" that is supposed to be wrapped in
FdoPtr<FdoFilter>, am I right?
then in next places it is not wrapped and causes memory leaks:
============================================
1) MapGuide\Server\src\Gws\GwsQueryEngine\GwsFeatureSourceQuery.cpp
in function:
CGwsPreparedFeatureQuery *
CGwsFeatureSourceQuery::PrepareFeatureQuery(...)
we should replace next:
stat = pQuery->Init ( sellist, orderByCols, orderingOption,
pFQuery->Filter
());
by:
FdoPtr<FdoFilter> pFilter = pFQuery->Filter();
stat = pQuery->Init(sellist, orderByCols, orderingOption, pFilter);
============================================
2) MapGuide\Server\src\Gws\GwsQueryEngine\GwsQueryDefinition.cpp
in function:
bool
GwsQueryDefinitionXmlHelpers::CompareQueries(IGWSQueryDefinition*
firstQuery, IGWSQueryDefinition* secondQuery)
we should replace next:
if(!GwsQueryDefinitionXmlHelpers::CompareToStringValues(firstQuery->Filter()
, secondQuery->Filter()))
by:
FdoPtr<FdoFilter> pFirstQuryFilter = firstQuery->Filter();
FdoPtr<FdoFilter> pSecondQuryFilter = secondQuery->Filter();
if(!GwsQueryDefinitionXmlHelpers::CompareToStringValues(pFirstQuryFilter.p,
pSecondQuryFilter.p))
I have catched those leaks during connection to SDF provider and after
first
fix my leaks dissapeared.
I also have tried to connect to SHP provider with simular code but got
another memory leaks. I haven't figure out where they come from yet, but I
suppose it can be from SHP provider implementation side.
Myabe someone have some information about it?
Best Regards,
Artem
}}}
--
Ticket URL: <https://trac.osgeo.org/mapguide/ticket/2825>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals
More information about the mapguide-trac
mailing list