fixed segmentation fault when speed/volume sliders are clicked and then dragged out of the scummvm window.

svn-id: r19683
This commit is contained in:
Robert Göffringmann 2005-11-21 18:21:44 +00:00
parent 9a09283a76
commit 619f0fa5a0

View File

@ -332,7 +332,8 @@ void Control::buttonControl(ConResource *pButton) {
return;
}
if (_curButtonText != pButton->_text) {
if (_textSprite) free(_textSprite);
if (_textSprite)
free(_textSprite);
_textSprite = NULL;
_curButtonText = pButton->_text;
if (pButton->_text) {
@ -345,9 +346,11 @@ void Control::buttonControl(ConResource *pButton) {
}
_textSprite = (dataFileHeader *)textRes.textData;
_text->setSprite(_textSprite);
} else _text->setSprite(NULL);
} else
_text->setSprite(NULL);
}
_text->setXY(_mouseX + 12, _mouseY - 16);
int destY = (_mouseY - 16 >= 0) ? _mouseY - 16 : 0;
_text->setXY(_mouseX + 12, destY);
}
void Control::drawTextCross(uint32 flags) {