From 851a86a9c673ace49928a67f9ae61dbf29296b35 Mon Sep 17 00:00:00 2001 From: Magnus Lundborg Date: Fri, 19 Sep 2014 14:37:03 +0200 Subject: Only free memory once. Since there is a problem with tng_particle_data_values_free it is better to free the memory only once. It will not be re-reserved anyhow. Change-Id: Ibef28820bee10e39f00ea0d4f1ee27fafdea6d23 diff --git a/src/tests/tng_io_testing.c b/src/tests/tng_io_testing.c index a9b7981..e154770 100644 --- a/src/tests/tng_io_testing.c +++ b/src/tests/tng_io_testing.c @@ -988,11 +988,6 @@ tng_function_status tng_test_get_positions_data(tng_trajectory_t traj, } } - tng_particle_data_values_free(traj, values, n_frames, n_particles, - n_values_per_frame, type); - - values = 0; - if(tng_particle_data_interval_get(traj, TNG_TRAJ_POSITIONS, 111000, 111499, hash_mode, &values, &n_particles, &n_values_per_frame, &type) == TNG_SUCCESS) @@ -1022,7 +1017,7 @@ tng_function_status tng_test_get_positions_data(tng_trajectory_t traj, { printf("Coordinates not in range. %s: %d\n", __FILE__, __LINE__); - tng_particle_data_values_free(traj, values, 50, n_particles, + tng_particle_data_values_free(traj, values, n_frames, n_particles, n_values_per_frame, type); return(TNG_FAILURE); } @@ -1031,7 +1026,7 @@ tng_function_status tng_test_get_positions_data(tng_trajectory_t traj, } } - tng_particle_data_values_free(traj, values, 50, n_particles, + tng_particle_data_values_free(traj, values, n_frames, n_particles, n_values_per_frame, type); return(TNG_SUCCESS); -- cgit v0.10.1