tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gw...@apache.org
Subject svn commit: r509676 - in /incubator/tuscany/cpp/sdo/runtime/core: src/commonj/sdo/EqualityHelper.cpp src/commonj/sdo/SDODataConverter.cpp src/commonj/sdo/SDOValue.cpp test/sdotest.cpp
Date Tue, 20 Feb 2007 17:40:26 GMT
Author: gwinn
Date: Tue Feb 20 09:40:25 2007
New Revision: 509676

URL: http://svn.apache.org/viewvc?view=rev&rev=509676
Log:
Fixes identified by valgrind.

Modified:
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/EqualityHelper.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDODataConverter.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOValue.cpp
    incubator/tuscany/cpp/sdo/runtime/core/test/sdotest.cpp

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/EqualityHelper.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/EqualityHelper.cpp?view=diff&rev=509676&r1=509675&r2=509676
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/EqualityHelper.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/EqualityHelper.cpp Tue Feb 20 09:40:25
2007
@@ -78,8 +78,8 @@
                             return false;
                         }
                     }
-                    delete buff;
-                    delete buft;
+                    delete[] buff;
+                    delete[] buft;
                 }
                 return true;
             }

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDODataConverter.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDODataConverter.cpp?view=diff&rev=509676&r1=509675&r2=509676
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDODataConverter.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDODataConverter.cpp Tue Feb 20
09:40:25 2007
@@ -147,7 +147,7 @@
                }
                tmpstr[sourceValue.WideString.length] = 0;
                char result = (char) atoi(tmpstr);
-               delete tmpstr;
+               delete[] tmpstr;
                return result;
             }
             default:
@@ -268,7 +268,7 @@
                }
                tmpstr[sourceValue.WideString.length] = 0;
                short result = (short) atoi(tmpstr);
-               delete tmpstr;
+               delete[] tmpstr;
                return result;
             }
             
@@ -330,7 +330,7 @@
                }
                tmpstr[sourceValue.WideString.length] = 0;
                long result = (long) atoi(tmpstr);
-               delete tmpstr;
+               delete[] tmpstr;
                return result;
             }
             
@@ -666,7 +666,7 @@
 
                tmpbuf[sourceValue.WideString.length] = 0;
                SDOString* result = new SDOString(tmpbuf);
-               delete tmpbuf;
+               delete[] tmpbuf;
                return result;
             }
                

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOValue.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOValue.cpp?view=diff&rev=509676&r1=509675&r2=509676
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOValue.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOValue.cpp Tue Feb 20 09:40:25
2007
@@ -41,7 +41,7 @@
 
         value.TextString = new SDOString(temp_buffer, len);
 
-        delete temp_buffer;
+        delete[] temp_buffer;
      }
 
      SDOValue::SDOValue(const wchar_t* inValue, unsigned int len) : 

Modified: incubator/tuscany/cpp/sdo/runtime/core/test/sdotest.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/test/sdotest.cpp?view=diff&rev=509676&r1=509675&r2=509676
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/test/sdotest.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/test/sdotest.cpp Tue Feb 20 09:40:25 2007
@@ -1534,7 +1534,7 @@
 
     mdg->setDefault("myspace","DefaultTest","string", help, 4);
 
-    delete help;
+    delete[] help;
 
     char* help2 = new char[4];
     help2[0] = 'H';
@@ -1546,7 +1546,7 @@
 
     mdg->setDefault("myspace","DefaultTest","bytes", help2, 4);
 
-    delete help2;
+    delete[] help2;
 
     mdg->addPropertyToType(tm,"object",       "myspace","AnObject");
 
@@ -1689,7 +1689,7 @@
 
     mdg->setDefault(ns1, testName, "string", help, 4);
 
-    delete help;
+    delete[] help;
 
     char* help2 = new char[4];
     help2[0] = 'H';
@@ -1701,7 +1701,7 @@
 
     mdg->setDefault(ns1, testName, "bytes", help2, 4);
 
-    delete help2;
+    delete[] help2;
 
     mdg->addPropertyToType(tm, "object", ns1, objectName);
 
@@ -2271,7 +2271,7 @@
     chs[3] = 'l';
     chs[4] = 'o';
     s->addString(9/*"string"*/,chs,5);
-    delete chs;
+    delete[] chs;
     s->addBytes(10/*"bytes"*/,"hello",5) ;
     s->addDataObject(11/*"object"*/,ob) ;
 
@@ -3545,12 +3545,12 @@
         fprintf(f, "Normal exception caught\n");
     }
 
-    delete bytes;
-    delete bytes2;
-    delete bytes3;
-    delete mbytes;
-    delete mbytes2;
-    delete mbytes3;
+    delete[] bytes;
+    delete[] bytes2;
+    delete[] bytes3;
+    delete[] mbytes;
+    delete[] mbytes2;
+    delete[] mbytes3;
 
     fclose (f);
     return comparefiles("querytest.dat","querytest.txt");



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message