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!