I have an application with a QAccelerometer that lasts the duration of the application and is read at a high frequency. Should the pointer QAccelerometerReading* returned by the reading() function be deleted after each reading is taken?
I have an application with a QAccelerometer that lasts the duration of the application and is read at a high frequency. Should the pointer QAccelerometerReading* returned by the reading() function be deleted after each reading is taken?
Hi
you should not delete QAccelerometerReading* pointer returned by the QAccelerometer::reading() because this function is just accessor to property 'reading' -- it does not allocate memory that must be released by client.
Thanks to izinin. I just wanted to make double sure I don't create serious heap corruption or memory leaks since these problems are not immediately obvious when one runs or debugs the application.