Results 1 to 2 of 2

Thread: Memory problems, please help!

  1. #1
    Join Date
    Sep 2009
    Posts
    64

    Default Memory problems, please help!

    I have an application that has given me no problems for the last week... I boot it up this morning and all of a sudden I am getting unhandled exceptions that point to a memory leak of some sort... I have been trying to figure out why and fix it, but have come up empty handed.

    Qt Code:
    1. void WInterface::toggleCueingSize()
    2. {
    3. QPushButton *clickedButton = qobject_cast<QPushButton *>(sender());
    4. if (clickedButton != 0)
    5. {
    6. std::string compareString = clickedButton->objectName().toStdString();
    7. if (compareString.compare("bannerSensorSelectButton")==0)
    8. {
    9. ui->wBannerSensorDisplay->show();
    10. ui->wSensorOnlyDisplay->hide();
    11. ui->viewModeSettings->hide();
    12. }
    13. else if (compareString.compare("sensorOnlySelectButton")==0)
    14. {
    15. ui->wBannerSensorDisplay->hide();
    16. ui->wSensorOnlyDisplay->show();
    17. ui->viewModeSettings->hide();
    18. }
    19. else if (ui->weaponsSensorOnlyDisplay->isHidden())
    20. {
    21. ui->wBannerSensorDisplay->hide();
    22. ui->wSensorOnlyDisplay->show();
    23. }
    24. else
    25. {
    26. ui->wBannerSensorDisplay->show();
    27. ui->wSensorOnlyDisplay->hide();
    28. }
    29. }
    30. }
    To copy to clipboard, switch view to plain text mode 

    this code gives me this error:

    HEAP[PresQT.exe]: Invalid Address specified to RtlFreeHeap( 003F0000, 02C45BA0 )
    Unhandled exception at 0x7c90120e in PresQT.exe: User breakpoint.

    and it is crashing somewhere in free.c

    I have commented out the the QPushButton assignment along with the string and the 2 conditional statements that involve the string, and it works fine... so it has something to do with the dynamic cast and the string assignment, but i dont know why or where the problem is...

    anyone have any idea? help is greatly appreciated!

  2. #2
    Join Date
    Sep 2009
    Posts
    64

    Default Re: Memory problems, please help!

    found the problem... apparently getObject() is an unstable function... switched to text() and now have no problems

Similar Threads

  1. Changing memory allocation managment ( QT 4.4.3 )
    By Link130 in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 20th October 2009, 09:44
  2. Recommend memory management literature
    By frenk_castle in forum General Programming
    Replies: 3
    Last Post: 18th October 2009, 20:30
  3. How Qt update framebuffer memory
    By nrabara in forum Newbie
    Replies: 0
    Last Post: 25th April 2009, 13:20
  4. Memory debugging in windows
    By txandi in forum Qt Programming
    Replies: 3
    Last Post: 20th February 2009, 13:45
  5. Memory leak weirdness
    By Darhuuk in forum General Programming
    Replies: 10
    Last Post: 10th January 2008, 18:51

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
  •  
Qt is a trademark of The Qt Company.