Results 1 to 2 of 2

Thread: Memory management with QAudioOutput

  1. #1
    Join Date
    Jan 2010
    Location
    Perth, Australia
    Posts
    37
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Memory management with QAudioOutput

    Hi all, I'm writing a program that uses QAudioOutput::start(), which returns a QIODevice pointer. Does this device need to be manually deleted later? The class reference page doesn't seem to indicate either way.

  2. #2
    Join Date
    Jan 2010
    Location
    Perth, Australia
    Posts
    37
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Memory management with QAudioOutput

    I found the answer.

    Qt Code:
    1. QAudioOutput *audioOutput = new QAudioOutput(myAudioFormat, this);
    2. QIODevice *ioDevice = audioOutput->start();
    3. qDebug() << "Parent is" << ioDevice->parent();
    To copy to clipboard, switch view to plain text mode 
    ...gives the following:
    Parent is QObject(0x0)
    So nobody owns the QIODevice, so it has to be manually deleted.

    EDIT: Nope, I was mistaken... even though nobody owns the QIODevice, it still gets automatically deleted when QAudioOutput::stop() is called.
    Last edited by hackerNovitiate; 20th January 2012 at 05:56. Reason: Wrong conclusion

Similar Threads

  1. Memory management in Qt?
    By wookoon in forum Qt Programming
    Replies: 7
    Last Post: 6th November 2010, 18:20
  2. Memory Management Reg
    By BalaQT in forum Newbie
    Replies: 10
    Last Post: 4th February 2010, 12:43
  3. Memory management
    By cyberboy in forum Qt Programming
    Replies: 2
    Last Post: 12th June 2008, 20:48
  4. Memory management questions (im new to Qt)
    By scarvenger in forum Qt Programming
    Replies: 2
    Last Post: 6th May 2007, 07:41
  5. Memory management in QT
    By Gayathri in forum Qt Programming
    Replies: 1
    Last Post: 17th November 2006, 07:21

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.