Use the correct syntax to delete a C++ array (closes CID 1100073) 63/12763/3
Sylvestre Ledru [Mon, 30 Sep 2013 16:48:14 +0000 (18:48 +0200)]
Change-Id: I0fbd7d2b1daeecaa11248f39f058d0ff61b2d138

scilab/modules/external_objects_java/src/cpp/ScilabJavaEnvironment.cpp

index fea094e..10d5db7 100644 (file)
@@ -396,9 +396,8 @@ std::vector<std::string> ScilabJavaEnvironment::getCompletion(int id, char ** fi
     for (int i = 0; i < len; i++)
     {
         v.push_back(fields[i]);
-        delete fields[i];
     }
-    delete fields;
+    delete[] fields;
 
     return v;
 }