×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jan 2012
    Posts
    11

    Should the pointer returned by QAccelerometer::reading() be deleted?

    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?

  2. #2
    Nokia Developer Expert
    Join Date
    Oct 2007
    Posts
    441

    Re: Should the pointer returned by QAccelerometer::reading() be deleted?

    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.

  3. #3
    Registered User
    Join Date
    Jan 2012
    Posts
    11

    Re: Should the pointer returned by QAccelerometer::reading() be deleted?

    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.

Similar Threads

  1. Replies: 2
    Last Post: 2011-06-13, 09:02
  2. QAccelerometer shows strange effects after changing output range
    By srebrodolskite in forum [Archived] Qt Mobility Project
    Replies: 2
    Last Post: 2010-11-16, 00:05
  3. Replies: 11
    Last Post: 2010-11-11, 08:41
  4. Zero returned as UID
    By ssn.kishore in forum Symbian
    Replies: 2
    Last Post: 2008-05-05, 16:16

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •