Opened 15 years ago

Closed 15 years ago

#1039 closed defect (invalid)

Possible leak in selection

Reported by: jng Owned by:
Priority: low Milestone:
Component: General Version: 2.0.2
Severity: trivial Keywords:
Cc: tomfukushima, brucedechant External ID:

Description

In the file:

MgDev/Common/PlatformBase/MapLayer/SelectionBase.cpp

at the method: MgSelectionBase::GetFeatureExtents(...)

the spatial context reader is not being closed after being used.

Reference: http://trac.osgeo.org/mapguide/browser/trunk/MgDev/Common/PlatformBase/MapLayer/SelectionBase.cpp#L902

Change History (5)

comment:1 by jbirch, 15 years ago

Cc: tomfukushima brucedechant added

Jackie, is this a possible cause of the problem mentioned here?

http://n2.nabble.com/FW%3A--mapguide-users--MapGuide-runs-out-of-FDO-connections-under-Fusion-MGOS-2.1-Beta-tp3287689p3287689.html

It's a bit disturbing that connections are being held open; this will stop the server from shutting down in an orderly fashion for repository backups, etc...

comment:2 by pagameba, 15 years ago

that's what I was wondering too.

comment:3 by brucedechant, 15 years ago

The MgSpatialContextReader object doesn't need to call Close() because the destructor of the MgSpatialContextReader class automatically calls Close(). When the GetFeatureExtents() method finishes the MgSpatialContextReader object will go out of scope because it is a smart pointer and the destructor will automatically be called.

The preferred programming practice is to call Close() on any reader when finished, but in this particular case there is no harm in not calling it. Regardless I will update the code to conform to the proper use of readers.

There may still be a leak in the selection code, but not calling Close() is not the source of it.

in reply to:  1 comment:4 by jng, 15 years ago

That's what I initially thought, I just walked through the code from the starting point of MgSelectionBase::GetExtents (from that code fragment) and found what I thought was a spatial context reader not being closed.

Now that this is not the case (thanks Bruce for the clarification), I'll guess we'll just keep on hunting for the cause of this connection exhaustion problem.

Replying to jbirch:

Jackie, is this a possible cause of the problem mentioned here?

http://n2.nabble.com/FW%3A--mapguide-users--MapGuide-runs-out-of-FDO-connections-under-Fusion-MGOS-2.1-Beta-tp3287689p3287689.html

It's a bit disturbing that connections are being held open; this will stop the server from shutting down in an orderly fashion for repository backups, etc...

comment:5 by jbirch, 15 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.