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.
void WInterface::toggleCueingSize()
{
QPushButton *clickedButton
= qobject_cast<QPushButton
*>
(sender
());
if (clickedButton != 0)
{
std::string compareString = clickedButton->objectName().toStdString();
if (compareString.compare("bannerSensorSelectButton")==0)
{
ui->wBannerSensorDisplay->show();
ui->wSensorOnlyDisplay->hide();
ui->viewModeSettings->hide();
}
else if (compareString.compare("sensorOnlySelectButton")==0)
{
ui->wBannerSensorDisplay->hide();
ui->wSensorOnlyDisplay->show();
ui->viewModeSettings->hide();
}
else if (ui->weaponsSensorOnlyDisplay->isHidden())
{
ui->wBannerSensorDisplay->hide();
ui->wSensorOnlyDisplay->show();
}
else
{
ui->wBannerSensorDisplay->show();
ui->wSensorOnlyDisplay->hide();
}
}
}
void WInterface::toggleCueingSize()
{
QPushButton *clickedButton = qobject_cast<QPushButton *>(sender());
if (clickedButton != 0)
{
std::string compareString = clickedButton->objectName().toStdString();
if (compareString.compare("bannerSensorSelectButton")==0)
{
ui->wBannerSensorDisplay->show();
ui->wSensorOnlyDisplay->hide();
ui->viewModeSettings->hide();
}
else if (compareString.compare("sensorOnlySelectButton")==0)
{
ui->wBannerSensorDisplay->hide();
ui->wSensorOnlyDisplay->show();
ui->viewModeSettings->hide();
}
else if (ui->weaponsSensorOnlyDisplay->isHidden())
{
ui->wBannerSensorDisplay->hide();
ui->wSensorOnlyDisplay->show();
}
else
{
ui->wBannerSensorDisplay->show();
ui->wSensorOnlyDisplay->hide();
}
}
}
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!
Bookmarks