[mapguide-commits] r5189 - in trunk/MgDev:
Server/src/Gws/GwsQueryEngine Server/src/Services/Feature
Server/src/Services/Mapping Web/src/HttpHandler
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Fri Sep 24 01:12:12 EDT 2010
Author: waltweltonlair
Date: 2010-09-24 05:12:12 +0000 (Fri, 24 Sep 2010)
New Revision: 5189
Modified:
trunk/MgDev/Server/src/Gws/GwsQueryEngine/GwsBinaryFeature.cpp
trunk/MgDev/Server/src/Gws/GwsQueryEngine/GwsBinaryReader.cpp
trunk/MgDev/Server/src/Gws/GwsQueryEngine/GwsBinaryWriter.cpp
trunk/MgDev/Server/src/Gws/GwsQueryEngine/GwsFeatureQueryResults.cpp
trunk/MgDev/Server/src/Gws/GwsQueryEngine/GwsNestedLoopSortedBlockJoinQueryResults.cpp
trunk/MgDev/Server/src/Services/Feature/FeatureDistribution.h
trunk/MgDev/Server/src/Services/Feature/FeatureGeometricFunctions.h
trunk/MgDev/Server/src/Services/Feature/FeatureManipulationCommand.h
trunk/MgDev/Server/src/Services/Feature/FeatureNumericFunctions.h
trunk/MgDev/Server/src/Services/Feature/FeatureStringFunctions.h
trunk/MgDev/Server/src/Services/Feature/SelectAggregateCommand.h
trunk/MgDev/Server/src/Services/Feature/SelectCommand.cpp
trunk/MgDev/Server/src/Services/Feature/SelectCommand.h
trunk/MgDev/Server/src/Services/Feature/ServerDataReader.h
trunk/MgDev/Server/src/Services/Feature/ServerGetProviderCapabilities.cpp
trunk/MgDev/Server/src/Services/Mapping/ServerMappingService.cpp
trunk/MgDev/Web/src/HttpHandler/HttpRequestResponseHandler.h
trunk/MgDev/Web/src/HttpHandler/OgcServer.cpp
trunk/MgDev/Web/src/HttpHandler/WfsFeatureDefinitions.cpp
trunk/MgDev/Web/src/HttpHandler/WfsFeatures.h
trunk/MgDev/Web/src/HttpHandler/WfsGetFeatureParams.cpp
trunk/MgDev/Web/src/HttpHandler/WfsGetFeatureParams.h
trunk/MgDev/Web/src/HttpHandler/WmsFeatureInfo.h
trunk/MgDev/Web/src/HttpHandler/WmsFeatureProperties.h
trunk/MgDev/Web/src/HttpHandler/WmsLayerDefinitions.cpp
trunk/MgDev/Web/src/HttpHandler/WmsLayerDefinitions.h
trunk/MgDev/Web/src/HttpHandler/XmlParser.cpp
Log:
Minor cleanup...
Change code like the following:
if (pointer)
delete pointer;
to just:
delete pointer;
Calling delete with null is safe.
Modified: trunk/MgDev/Server/src/Gws/GwsQueryEngine/GwsBinaryFeature.cpp
===================================================================
--- trunk/MgDev/Server/src/Gws/GwsQueryEngine/GwsBinaryFeature.cpp 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Server/src/Gws/GwsQueryEngine/GwsBinaryFeature.cpp 2010-09-24 05:12:12 UTC (rev 5189)
@@ -42,8 +42,7 @@
CGwsBinaryFeature::~CGwsBinaryFeature () throw()
{
- if(m_pBinaryReader)
- delete m_pBinaryReader;
+ delete m_pBinaryReader;
}
Modified: trunk/MgDev/Server/src/Gws/GwsQueryEngine/GwsBinaryReader.cpp
===================================================================
--- trunk/MgDev/Server/src/Gws/GwsQueryEngine/GwsBinaryReader.cpp 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Server/src/Gws/GwsQueryEngine/GwsBinaryReader.cpp 2010-09-24 05:12:12 UTC (rev 5189)
@@ -54,8 +54,7 @@
delete [] (*iter);
}
- if (m_wcsCache)
- delete [] m_wcsCache;
+ delete [] m_wcsCache;
}
Modified: trunk/MgDev/Server/src/Gws/GwsQueryEngine/GwsBinaryWriter.cpp
===================================================================
--- trunk/MgDev/Server/src/Gws/GwsQueryEngine/GwsBinaryWriter.cpp 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Server/src/Gws/GwsQueryEngine/GwsBinaryWriter.cpp 2010-09-24 05:12:12 UTC (rev 5189)
@@ -37,9 +37,7 @@
BinaryWriter::~BinaryWriter()
{
delete [] m_data;
-
- if (m_strCache)
- delete [] m_strCache;
+ delete [] m_strCache;
}
@@ -161,9 +159,7 @@
if (m_strCacheLen < maxmbslen)
{
- if (m_strCache)
- delete [] m_strCache;
-
+ delete [] m_strCache;
m_strCacheLen = maxmbslen;
m_strCache = new char[maxmbslen];
}
@@ -207,9 +203,7 @@
if (m_strCacheLen < maxmbslen)
{
- if (m_strCache)
- delete [] m_strCache;
-
+ delete [] m_strCache;
m_strCacheLen = maxmbslen;
m_strCache = new char[maxmbslen];
}
Modified: trunk/MgDev/Server/src/Gws/GwsQueryEngine/GwsFeatureQueryResults.cpp
===================================================================
--- trunk/MgDev/Server/src/Gws/GwsQueryEngine/GwsFeatureQueryResults.cpp 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Server/src/Gws/GwsQueryEngine/GwsFeatureQueryResults.cpp 2010-09-24 05:12:12 UTC (rev 5189)
@@ -57,8 +57,7 @@
printf ("\n%ld points converted\n", nPoints);
}
#endif
- if(m_pBinaryWriter)
- delete m_pBinaryWriter;
+ delete m_pBinaryWriter;
}
@@ -691,9 +690,7 @@
unsigned char* CGwsFeatureIterator::ToBuffer(int& bufLen)
{
- if(m_pBinaryWriter != NULL)
- delete m_pBinaryWriter;
-
+ delete m_pBinaryWriter;
m_pBinaryWriter = new GwsBinaryFeatureWriter();
FdoPtr<IGWSExtendedFeatureDescription> ifdesc;
Modified: trunk/MgDev/Server/src/Gws/GwsQueryEngine/GwsNestedLoopSortedBlockJoinQueryResults.cpp
===================================================================
--- trunk/MgDev/Server/src/Gws/GwsQueryEngine/GwsNestedLoopSortedBlockJoinQueryResults.cpp 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Server/src/Gws/GwsQueryEngine/GwsNestedLoopSortedBlockJoinQueryResults.cpp 2010-09-24 05:12:12 UTC (rev 5189)
@@ -62,7 +62,6 @@
return stat;
}
m_prepquery = prepquery;
-
CGwsRightJoinQueryResults * results =
(CGwsRightJoinQueryResults *) rightquery->CreateFeatureIterator (eGwsRightNestedLoopSortedBlockIterator);
stat = results->InitializeReader (query, rightquery, rightcols, bScrollable);
@@ -73,5 +72,6 @@
m_right = results;
m_right->AddRef ();
}
+
return stat;
}
Modified: trunk/MgDev/Server/src/Services/Feature/FeatureDistribution.h
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/FeatureDistribution.h 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Server/src/Services/Feature/FeatureDistribution.h 2010-09-24 05:12:12 UTC (rev 5189)
@@ -33,7 +33,10 @@
MgFeatureDistribution();
virtual ~MgFeatureDistribution();
- virtual void Dispose() { delete this; }
+ virtual void Dispose()
+ {
+ delete this;
+ }
};
#endif
Modified: trunk/MgDev/Server/src/Services/Feature/FeatureGeometricFunctions.h
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/FeatureGeometricFunctions.h 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Server/src/Services/Feature/FeatureGeometricFunctions.h 2010-09-24 05:12:12 UTC (rev 5189)
@@ -38,7 +38,10 @@
MgFeatureGeometricFunctions();
virtual ~MgFeatureGeometricFunctions();
- virtual void Dispose() { delete this; }
+ virtual void Dispose()
+ {
+ delete this;
+ }
private:
Modified: trunk/MgDev/Server/src/Services/Feature/FeatureManipulationCommand.h
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/FeatureManipulationCommand.h 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Server/src/Services/Feature/FeatureManipulationCommand.h 2010-09-24 05:12:12 UTC (rev 5189)
@@ -26,7 +26,10 @@
static MgFeatureManipulationCommand* CreateCommand(MgFeatureCommand* command, MgServerFeatureConnection* connection, INT32 cmdId);
virtual MgProperty* Execute() = 0;
protected:
- virtual void Dispose() { delete this; }
+ virtual void Dispose()
+ {
+ delete this;
+ }
};
#endif
Modified: trunk/MgDev/Server/src/Services/Feature/FeatureNumericFunctions.h
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/FeatureNumericFunctions.h 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Server/src/Services/Feature/FeatureNumericFunctions.h 2010-09-24 05:12:12 UTC (rev 5189)
@@ -32,7 +32,10 @@
MgFeatureNumericFunctions(MgReader* reader, FdoFunction* customFunction, CREFSTRING propertyAlias);
virtual ~MgFeatureNumericFunctions();
virtual MgReader* Execute();
- virtual void Dispose() { delete this; }
+ virtual void Dispose()
+ {
+ delete this;
+ }
protected:
Modified: trunk/MgDev/Server/src/Services/Feature/FeatureStringFunctions.h
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/FeatureStringFunctions.h 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Server/src/Services/Feature/FeatureStringFunctions.h 2010-09-24 05:12:12 UTC (rev 5189)
@@ -36,7 +36,10 @@
MgFeatureStringFunctions();
virtual ~MgFeatureStringFunctions();
- virtual void Dispose() { delete this; }
+ virtual void Dispose()
+ {
+ delete this;
+ }
private:
Modified: trunk/MgDev/Server/src/Services/Feature/SelectAggregateCommand.h
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/SelectAggregateCommand.h 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Server/src/Services/Feature/SelectAggregateCommand.h 2010-09-24 05:12:12 UTC (rev 5189)
@@ -54,7 +54,11 @@
virtual bool SupportsSelectOrdering();
virtual bool SupportsSelectDistinct();
- virtual void Dispose() { delete this; }
+ virtual void Dispose()
+ {
+ delete this;
+ }
+
private:
Ptr<MgServerFeatureConnection> m_connection;
STRING m_providerName;
Modified: trunk/MgDev/Server/src/Services/Feature/SelectCommand.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/SelectCommand.cpp 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Server/src/Services/Feature/SelectCommand.cpp 2010-09-24 05:12:12 UTC (rev 5189)
@@ -254,7 +254,10 @@
bool IsFragmented() { return m_isFragmented; }
FdoFilter* GetNewFilter() { return m_newFilter ? FDO_SAFE_ADDREF(m_newFilter.p) : NULL; }
- virtual void Dispose() { delete this; }
+ virtual void Dispose()
+ {
+ delete this;
+ }
virtual void ProcessBinaryLogicalOperator(FdoBinaryLogicalOperator& filter)
{
Modified: trunk/MgDev/Server/src/Services/Feature/SelectCommand.h
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/SelectCommand.h 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Server/src/Services/Feature/SelectCommand.h 2010-09-24 05:12:12 UTC (rev 5189)
@@ -60,7 +60,10 @@
virtual bool SupportsSelectOrdering();
virtual bool SupportsSelectDistinct();
- virtual void Dispose() { delete this; }
+ virtual void Dispose()
+ {
+ delete this;
+ }
private:
Ptr<MgServerFeatureConnection> m_connection;
Modified: trunk/MgDev/Server/src/Services/Feature/ServerDataReader.h
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerDataReader.h 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Server/src/Services/Feature/ServerDataReader.h 2010-09-24 05:12:12 UTC (rev 5189)
@@ -429,7 +429,6 @@
MgByteReader* ToXml();
protected:
-
virtual void Dispose()
{
delete this;
Modified: trunk/MgDev/Server/src/Services/Feature/ServerGetProviderCapabilities.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerGetProviderCapabilities.cpp 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Server/src/Services/Feature/ServerGetProviderCapabilities.cpp 2010-09-24 05:12:12 UTC (rev 5189)
@@ -98,11 +98,8 @@
m_fdoConn = NULL;
- if (NULL != m_xmlUtil)
- delete m_xmlUtil;
-
- if (NULL != m_xmlCap)
- delete m_xmlCap;
+ delete m_xmlUtil;
+ delete m_xmlCap;
}
Modified: trunk/MgDev/Server/src/Services/Mapping/ServerMappingService.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Mapping/ServerMappingService.cpp 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Server/src/Services/Mapping/ServerMappingService.cpp 2010-09-24 05:12:12 UTC (rev 5189)
@@ -714,8 +714,7 @@
if (*iter) (*iter)->Release();
//finally clean up if needed
- if (xformToLL)
- delete xformToLL;
+ delete xformToLL;
return byteReader.Detach();
}
Modified: trunk/MgDev/Web/src/HttpHandler/HttpRequestResponseHandler.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpRequestResponseHandler.h 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Web/src/HttpHandler/HttpRequestResponseHandler.h 2010-09-24 05:12:12 UTC (rev 5189)
@@ -92,7 +92,10 @@
/// <returns>
/// Classification of handler
/// </returns>
- virtual MgRequestClassification GetRequestClassification() { return MgHttpRequestResponseHandler::mrcAuthor; }
+ virtual MgRequestClassification GetRequestClassification()
+ {
+ return MgHttpRequestResponseHandler::mrcAuthor;
+ }
protected:
/// <summary>
@@ -100,7 +103,10 @@
/// its member variables and then destruct itself.
/// </summary>
/// <returns>Returns nothing</returns>
- virtual void Dispose() { delete this; }
+ virtual void Dispose()
+ {
+ delete this;
+ }
/// <summary>
/// This method is responsible for checking if
Modified: trunk/MgDev/Web/src/HttpHandler/OgcServer.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/OgcServer.cpp 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Web/src/HttpHandler/OgcServer.cpp 2010-09-24 05:12:12 UTC (rev 5189)
@@ -1737,11 +1737,10 @@
m_pTopOfDefinitions = m_pTopOfDefinitions->NextScope();
- delete(pOldTop);
+ delete pOldTop;
}
-
bool MgOgcServer::Write(CPSZ pszText)
{
if(!m_bWriteEnabled)
Modified: trunk/MgDev/Web/src/HttpHandler/WfsFeatureDefinitions.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/WfsFeatureDefinitions.cpp 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Web/src/HttpHandler/WfsFeatureDefinitions.cpp 2010-09-24 05:12:12 UTC (rev 5189)
@@ -73,8 +73,7 @@
MgWfsFeatureDefinitions::~MgWfsFeatureDefinitions()
{
- if(m_pXmlInput != NULL)
- delete(m_pXmlInput);
+ delete m_pXmlInput;
}
Modified: trunk/MgDev/Web/src/HttpHandler/WfsFeatures.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/WfsFeatures.h 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Web/src/HttpHandler/WfsFeatures.h 2010-09-24 05:12:12 UTC (rev 5189)
@@ -32,7 +32,10 @@
bool Next();
void GenerateDefinitions(MgUtilDictionary& Dictionary);
bool GenerateNamespacesDefinition(MgUtilDictionary& Dictionary);
- virtual void Dispose(){delete this;}
+ virtual void Dispose()
+ {
+ delete this;
+ }
private:
STRING m_sFeatureCollection; // the entire blob of features
Modified: trunk/MgDev/Web/src/HttpHandler/WfsGetFeatureParams.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/WfsGetFeatureParams.cpp 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Web/src/HttpHandler/WfsGetFeatureParams.cpp 2010-09-24 05:12:12 UTC (rev 5189)
@@ -102,7 +102,7 @@
WfsGetFeatureParams::~WfsGetFeatureParams()
{
- delete(m_pNamespaces);
+ delete m_pNamespaces;
}
MgXmlNamespaceManager& WfsGetFeatureParams::NamespaceManager()
Modified: trunk/MgDev/Web/src/HttpHandler/WfsGetFeatureParams.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/WfsGetFeatureParams.h 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Web/src/HttpHandler/WfsGetFeatureParams.h 2010-09-24 05:12:12 UTC (rev 5189)
@@ -136,7 +136,10 @@
WfsGetFeatureParams();
protected:
- virtual void Dispose(){delete this;}
+ virtual void Dispose()
+ {
+ delete this;
+ }
private:
// Use this in lieu of direct access to parameters.
Modified: trunk/MgDev/Web/src/HttpHandler/WmsFeatureInfo.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/WmsFeatureInfo.h 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Web/src/HttpHandler/WmsFeatureInfo.h 2010-09-24 05:12:12 UTC (rev 5189)
@@ -37,7 +37,10 @@
MgWmsFeatureProperties* GetCurrentProperties();
protected:
- virtual void Dispose(){delete this;}
+ virtual void Dispose()
+ {
+ delete this;
+ }
private:
Ptr<MgBatchPropertyCollection> m_propertyCollection;
Modified: trunk/MgDev/Web/src/HttpHandler/WmsFeatureProperties.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/WmsFeatureProperties.h 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Web/src/HttpHandler/WmsFeatureProperties.h 2010-09-24 05:12:12 UTC (rev 5189)
@@ -34,7 +34,10 @@
void GenerateDefinitions(MgUtilDictionary& Dictionary);
protected:
- virtual void Dispose(){delete this;}
+ virtual void Dispose()
+ {
+ delete this;
+ }
private:
Ptr<MgPropertyCollection> m_propertyCollection;
Modified: trunk/MgDev/Web/src/HttpHandler/WmsLayerDefinitions.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/WmsLayerDefinitions.cpp 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Web/src/HttpHandler/WmsLayerDefinitions.cpp 2010-09-24 05:12:12 UTC (rev 5189)
@@ -93,11 +93,8 @@
MgWmsLayerDefinitions::~MgWmsLayerDefinitions()
{
- if(m_xmlParser != NULL)
- {
- delete m_xmlParser;
- m_xmlParser = NULL;
- }
+ delete m_xmlParser;
+ m_xmlParser = NULL;
}
bool MgWmsLayerDefinitions::Next()
Modified: trunk/MgDev/Web/src/HttpHandler/WmsLayerDefinitions.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/WmsLayerDefinitions.h 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Web/src/HttpHandler/WmsLayerDefinitions.h 2010-09-24 05:12:12 UTC (rev 5189)
@@ -40,7 +40,10 @@
void Reset();
protected:
- virtual void Dispose(){delete this;}
+ virtual void Dispose()
+ {
+ delete this;
+ }
private:
bool SkipElement(CPSZ pszElementName);
Modified: trunk/MgDev/Web/src/HttpHandler/XmlParser.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/XmlParser.cpp 2010-09-24 05:10:37 UTC (rev 5188)
+++ trunk/MgDev/Web/src/HttpHandler/XmlParser.cpp 2010-09-24 05:12:12 UTC (rev 5189)
@@ -526,17 +526,16 @@
MgXmlParser::~MgXmlParser()
{
- if(m_sString != NULL)
+ if (m_sString != NULL)
free((void*)m_sString);
- if(m_pCurrent != NULL)
- delete(m_pCurrent);
+
+ delete m_pCurrent;
}
// Resets the enumerator.
void MgXmlParser::Reset()
{
- if(m_pCurrent != NULL)
- delete(m_pCurrent);
+ delete m_pCurrent;
m_pCurrent = new MgXmlInvalid();
m_iPos = UNINITIALIZED_XSIZE_T;
}
@@ -558,7 +557,7 @@
bool bSkipping;
do {
if(AtEnd()) {
- delete(m_pCurrent);
+ delete m_pCurrent;
m_pCurrent = new MgXmlInvalid();
return false;
}
@@ -572,10 +571,8 @@
CPSZ pszDebug = ((CPSZ)m_sString)+m_iPos; pszDebug;
// Clean up what was there before.
- if(m_pCurrent != NULL) {
- delete(m_pCurrent);
- m_pCurrent = NULL; // Note: not new MgXmlInvalid(); pointer will be set soon.
- }
+ delete m_pCurrent;
+ m_pCurrent = NULL; // Note: not new MgXmlInvalid(); pointer will be set soon.
// Examine what is under the "cursor" in our scan forward.
if(m_sString[m_iPos] == '<') {
@@ -692,7 +689,7 @@
{
MgXmlNamespaceScope* pOldTop = m_pTopScope;
m_pTopScope = (MgXmlNamespaceScope*)m_pTopScope->NextScope();
- delete(pOldTop);
+ delete pOldTop;
}
}
@@ -740,7 +737,7 @@
// Remove that top scope.
MgXmlNamespaceScope* pOldTop = m_pTopScope;
m_pTopScope = (MgXmlNamespaceScope*)m_pTopScope->NextScope();
- delete(pOldTop);
+ delete pOldTop;
return true;
}
More information about the mapguide-commits
mailing list