Fix an invalid pointer reference in the widget code by making sure that the pointer to the widget currently under the mouse is cleared when the
widget is freed. git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3064 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
e0c450b415
commit
65c56b73e3
|
@ -126,6 +126,13 @@ void widgReleaseWidgetList(WIDGET *psWidgets)
|
||||||
for(psCurr = psWidgets; psCurr; psCurr = psNext)
|
for(psCurr = psWidgets; psCurr; psCurr = psNext)
|
||||||
{
|
{
|
||||||
psNext = psCurr->psNext;
|
psNext = psCurr->psNext;
|
||||||
|
|
||||||
|
// the mouse can't be over it anymore
|
||||||
|
if (psMouseOverWidget && psMouseOverWidget->id == psCurr->id)
|
||||||
|
{
|
||||||
|
psMouseOverWidget = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
switch(psCurr->type)
|
switch(psCurr->type)
|
||||||
{
|
{
|
||||||
case WIDG_FORM:
|
case WIDG_FORM:
|
||||||
|
@ -667,6 +674,11 @@ void widgDelete(W_SCREEN *psScreen, UDWORD id)
|
||||||
{
|
{
|
||||||
screenClearFocus(psScreen);
|
screenClearFocus(psScreen);
|
||||||
}
|
}
|
||||||
|
// the mouse can't be over it anymore
|
||||||
|
if (psMouseOverWidget && psMouseOverWidget->id == id)
|
||||||
|
{
|
||||||
|
psMouseOverWidget = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Set up the initial context */
|
/* Set up the initial context */
|
||||||
sContext.psScreen = psScreen;
|
sContext.psScreen = psScreen;
|
||||||
|
|
Loading…
Reference in New Issue