[MOAB-dev] commit/MOAB: danwu: To delete the memory allocated by read_variable_to_set_allocate(), data types should be consistent with new.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon Nov 25 12:51:19 CST 2013


1 new commit in MOAB:

https://bitbucket.org/fathomteam/moab/commits/600c90a34f29/
Changeset:   600c90a34f29
Branch:      master
User:        danwu
Date:        2013-11-25 19:51:07
Summary:     To delete the memory allocated by read_variable_to_set_allocate(), data types should be consistent with new.

Affected #:  1 file

diff --git a/src/io/NCHelper.cpp b/src/io/NCHelper.cpp
index 89245a4..0f8a7fa 100644
--- a/src/io/NCHelper.cpp
+++ b/src/io/NCHelper.cpp
@@ -446,16 +446,12 @@ ErrorCode NCHelper::read_variable_to_set(std::vector<ReadNC::VarData>& vdatas, s
           delete[] (char*) data;
           break;
         case NC_DOUBLE:
-          delete[] (double*) data;
-          break;
         case NC_FLOAT:
-          delete[] (float*) data;
+          delete[] (double*) data;
           break;
         case NC_INT:
-          delete[] (int*) data;
-          break;
         case NC_SHORT:
-          delete[] (short*) data;
+          delete[] (int*) data;
           break;
         default:
           break;
@@ -860,7 +856,7 @@ ErrorCode NCHelper::read_variable_to_set_allocate(std::vector<ReadNC::VarData>&
           vdatas[i].varDatas[t] = new int[sz];
           break;
         default:
-          std::cerr << "Unrecognized data type for tag " << std::endl;
+          std::cerr << "Unrecognized data type for set variable tag values" << std::endl;
           rval = MB_FAILURE;
       }

Repository URL: https://bitbucket.org/fathomteam/moab/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.


More information about the moab-dev mailing list