ldt0028: Removed new for example array

Not necessary in C++.  This was getting flagged as a memory
leak in the examples.  Not a big deal, but can be done differently.

Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
Noel Eck 2017-03-29 16:38:13 -07:00
parent a760f2952a
commit 2f051a202c

View File

@ -44,7 +44,7 @@ main(int argc, char **argv)
std::cout << "For the next " << NUMBER_OF_SECONDS << " seconds, "
<< SAMPLES_PER_SECOND << " samples will be taken every second."
<< std::endl << std::endl;
uint16_t* buffer = new uint16_t[NUMBER_OF_SECONDS * SAMPLES_PER_SECOND];
uint16_t buffer[NUMBER_OF_SECONDS * SAMPLES_PER_SECOND];
for (int i=0; i < NUMBER_OF_SECONDS * SAMPLES_PER_SECOND; i++) {
buffer[i] = (uint16_t) sensor->getSample();
usleep(MICROSECONDS_PER_SECOND / SAMPLES_PER_SECOND);