Fix memory leaks in combined dialog.

SVN revision: 25558
This commit is contained in:
Kim Woelders 2006-09-06 20:52:52 +00:00
parent 0cca68ca52
commit cffc466d8a
3 changed files with 11 additions and 2 deletions

View File

@ -321,6 +321,13 @@ DialogSetExitFunction(Dialog * d, DialogCallbackFunc * func, int val)
d->exit_val = val;
}
void
DialogCallExitFunction(Dialog * d)
{
if (d->exit_func)
d->exit_func(d, d->exit_val, NULL);
}
void
DialogSetData(Dialog * d, void *data)
{
@ -630,8 +637,7 @@ _DialogClose(Dialog * d)
if (!d)
return;
if (d->exit_func)
d->exit_func(d, d->exit_val, NULL);
DialogCallExitFunction(d);
EwinHide(d->ewin);
}

View File

@ -80,6 +80,7 @@ void DialogSetText(Dialog * d, const char *text);
void DialogSetTitle(Dialog * d, const char *title);
void DialogSetExitFunction(Dialog * d, DialogCallbackFunc * func,
int val);
void DialogCallExitFunction(Dialog * d);
void DialogSetData(Dialog * d, void *data);
void *DialogGetData(Dialog * d);

View File

@ -656,6 +656,8 @@ CB_DlgSelect(Dialog * d, int val, void *data)
if (!dd->fill)
return;
DialogCallExitFunction(d);
DialogItemTableEmpty(table);
DialogKeybindingsDestroy(d);