Index: MapGuideCommon/Controller/HtmlController.cpp
===================================================================
--- MapGuideCommon/Controller/HtmlController.cpp (revision 8564)
+++ MapGuideCommon/Controller/HtmlController.cpp (working copy)
@@ -278,21 +278,22 @@
// Call the C++ API, regardless of bitmask as any part of the mask will require information from this API
featureInfo = service->QueryFeatures(map, layerNames, selectionGeometry, selectionVariant, featureFilter, maxFeatures, layerAttributeFilter);
+ Ptr selection;
+ if (NULL != featureInfo.p)
+ selection = featureInfo->GetSelection();
+ if(!selection)
+ selection = new MgSelection(map);
+
if (persist)
{
//save the selection set in the session repository
- Ptr selection;
- if (NULL != featureInfo.p)
- selection = featureInfo->GetSelection();
- if(!selection)
- selection = new MgSelection(map);
selection->Save(resourceService, mapName);
- newSelection = SAFE_ADDREF(selection.p);
-
- //Needed for GetLayers() to work below
- newSelection->SetMap(map);
}
+ newSelection = SAFE_ADDREF(selection.p);
+ //Needed for GetLayers() to work below
+ newSelection->SetMap(map);
+
// Render an image of this selection if requested
if (((requestData & REQUEST_INLINE_SELECTION) == REQUEST_INLINE_SELECTION) && NULL != newSelection.p)
{