axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject svn commit: r379785 - in /webservices/axis/trunk/c/src/common: ArrayBean.cpp AxisFile.h
Date Wed, 22 Feb 2006 15:14:06 GMT
Author: dicka
Date: Wed Feb 22 07:14:03 2006
New Revision: 379785

URL: http://svn.apache.org/viewcvs?rev=379785&view=rev
Log:
AXISCPP-933

Resolve problem of trace file handle not be correctly closed when using start up trace but
not runtime trace.

Modified:
    webservices/axis/trunk/c/src/common/ArrayBean.cpp
    webservices/axis/trunk/c/src/common/AxisFile.h

Modified: webservices/axis/trunk/c/src/common/ArrayBean.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/common/ArrayBean.cpp?rev=379785&r1=379784&r2=379785&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/common/ArrayBean.cpp (original)
+++ webservices/axis/trunk/c/src/common/ArrayBean.cpp Wed Feb 22 07:14:03 2006
@@ -55,102 +55,253 @@
                 m_value.cta->pObject = NULL;
             }
             delete m_value.cta;
+			m_value.cta = NULL;
         }
     }
     else if (AxisEngine::m_bServer && m_value.sta)
     {
-        switch (m_type)
+        if (m_nSize > 0)
         {
-            case XSD_BYTE:
-            case XSD_UNSIGNEDBYTE:
+            for (int count = 0 ; count < m_nSize ; count++)
             {
-                char* a = (char*)m_value.sta;
-                delete [] a;
-            }
-                break;
-            case XSD_SHORT:
-            case XSD_UNSIGNEDSHORT:
-            {
-                short* a = (short*)m_value.sta;
-                delete [] a;
-            }
-                break;
-            case XSD_INT:
-            case XSD_UNSIGNEDINT:
-            case XSD_BOOLEAN:
-            {
-                int* a = (int*)m_value.sta;
-                delete [] a;
-            }
-                break;
-            case XSD_LONG:
-            case XSD_INTEGER:
-            case XSD_UNSIGNEDLONG:
-			{
-                LONGLONG* a = (LONGLONG *)m_value.sta;
-                delete [] a;
-            }
-                break;
-            case XSD_DURATION:		
-            {
-                long* a = (long*)m_value.sta;
-                delete [] a;
-            }
-                break;
-            case XSD_FLOAT:
-            {
-                float* a = (float*)m_value.sta;
-                delete [] a;
-            }
-                break;
-            case XSD_DOUBLE:
-            case XSD_DECIMAL:
-            {
-                double* a = (double*)m_value.sta;
-                delete [] a;
-            }
-                break;
-            case XSD_STRING:
-            case XSD_ANYURI:
-            case XSD_QNAME:
-            case XSD_NOTATION:			
-            {
-                AxisChar** a = (AxisChar**)m_value.sta;
-                for (int ix=0;ix<m_nSize;ix++)
+                if ( ((void **) m_value.sta)[count] != NULL)
                 {
-                    delete [] a[ix];
+                    switch (m_type)
+                    {
+                        case XSD_DURATION:
+                        {
+                            delete ((xsd__duration**) m_value.sta)[count];
+                          break;
+                        }
+                        case XSD_DATETIME:
+                        {
+                            delete ((xsd__dateTime**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_TIME:
+                        {
+                            delete ((xsd__time**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_DATE:
+                        {
+                            delete ((xsd__date**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_GYEARMONTH:
+                        {
+                            delete ((xsd__gYearMonth**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_GYEAR:
+                        {
+                            delete ((xsd__gYear**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_GMONTHDAY:
+                        {
+                            delete ((xsd__gMonthDay**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_GDAY:
+                        {
+                            delete ((xsd__gDay**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_GMONTH:
+                        {
+                            delete ((xsd__gMonth**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_STRING:
+                        {
+                            delete []((xsd__string*) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_NORMALIZEDSTRING:
+                        {
+                            delete []((xsd__normalizedString*) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_TOKEN:
+                        {
+                            delete []((xsd__token*) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_LANGUAGE:
+                        {
+                            delete []((xsd__language*) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_NAME:
+                        {
+                            delete []((xsd__Name*) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_NCNAME:
+                        {
+                            delete []((xsd__NCName*) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_ID:
+                        {
+                            delete []((xsd__ID*) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_IDREF:
+                        {
+                            delete []((xsd__IDREF*) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_IDREFS:
+                        {
+                            delete []((xsd__IDREFS*) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_ENTITY:
+                        {
+                            delete []((xsd__ENTITY*) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_ENTITIES:
+                        {
+                            delete []((xsd__ENTITIES*) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_NMTOKEN:
+                        {
+                            delete []((xsd__NMTOKEN*) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_NMTOKENS:
+                        {
+                            delete []((xsd__NMTOKENS*) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_BOOLEAN:
+                        {
+                            delete ((xsd__boolean**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_BASE64BINARY:
+                        {
+                            delete ((xsd__base64Binary**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_HEXBINARY:
+                        {
+                            delete ((xsd__hexBinary**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_FLOAT:
+                        {
+                            delete ((xsd__float**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_DECIMAL:
+                        {
+                            delete ((xsd__decimal**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_INTEGER:
+                        {
+                            delete ((xsd__integer**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_NONPOSITIVEINTEGER:
+                        {
+                            delete ((xsd__nonPositiveInteger**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_NEGATIVEINTEGER:
+                        {
+                            delete ((xsd__negativeInteger**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_LONG:
+                        {
+                            delete ((xsd__long**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_INT:
+                        {
+                            delete ((xsd__int**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_SHORT:
+                        {
+                            delete ((xsd__short**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_BYTE:
+                        {
+                            delete ((xsd__byte**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_NONNEGATIVEINTEGER:
+                        {
+                            delete ((xsd__nonNegativeInteger**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_UNSIGNEDLONG:
+                        {
+                            delete ((xsd__unsignedLong**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_UNSIGNEDINT:
+                        {
+                            delete ((xsd__unsignedInt**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_UNSIGNEDSHORT:
+                        {
+                            delete ((xsd__unsignedShort**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_UNSIGNEDBYTE:
+                        {
+                            delete ((xsd__unsignedByte**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_POSITIVEINTEGER:
+                        {
+                            delete ((xsd__positiveInteger**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_DOUBLE:
+                        {
+                            delete ((xsd__double**) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_ANYURI:
+                        {
+                            delete []((xsd__anyURI*) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_QNAME:
+                        {
+                            delete []((xsd__QName*) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_NOTATION:
+                        {
+                            delete []((xsd__NOTATION*) m_value.sta)[count];
+                            break;
+                        }
+                        case XSD_ARRAY:
+                        {
+                            delete ((Axis_Array**) m_value.sta)[count];
+                            break;
+                        }
+                        default:
+                            break;
+                    }
                 }
-                delete [] a;
-            }
-                break;
-            case XSD_HEXBINARY:
-            {
-                xsd__hexBinary* a = (xsd__hexBinary*)m_value.sta;
-                delete [] a;
-            }
-                break;
-            case XSD_BASE64BINARY:
-            {
-                xsd__base64Binary* a = (xsd__base64Binary*)m_value.sta;
-                delete [] a;
-            }
-                break;
-            case XSD_DATETIME:
-            case XSD_TIME:
-            case XSD_DATE:
-            case XSD_GYEARMONTH:
-            case XSD_GYEAR:
-            case XSD_GMONTHDAY:
-            case XSD_GDAY:
-            case XSD_GMONTH:
-            {
-                tm* a = (tm*)m_value.sta;
-                delete [] a;
             }
-                break;
-                // continue this for all basic types
-                default:;
+            m_nSize = 0;
         }
+        delete [] m_value.sta;
+        m_value.sta = NULL;
     }
 }
 

Modified: webservices/axis/trunk/c/src/common/AxisFile.h
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/common/AxisFile.h?rev=379785&r1=379784&r2=379785&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/common/AxisFile.h (original)
+++ webservices/axis/trunk/c/src/common/AxisFile.h Wed Feb 22 07:14:03 2006
@@ -120,7 +120,10 @@
     ~AxisFile()
     {
         if(pFILEFile)
+        {
             fclose(pFILEFile);
+            pFILEFile = NULL;
+        }
     }
 
 private:



Mime
View raw message