msi: Only cleanup event subscriptions of the dialog being closed.

This commit is contained in:
James Hawkins 2006-12-18 01:48:25 -06:00 committed by Alexandre Julliard
parent 975d7ff292
commit 6f3f2549c1
1 changed files with 19 additions and 1 deletions

View File

@ -54,6 +54,7 @@ struct subscriber {
}; };
UINT ControlEvent_HandleControlEvent(MSIPACKAGE *, LPCWSTR, LPCWSTR, msi_dialog*); UINT ControlEvent_HandleControlEvent(MSIPACKAGE *, LPCWSTR, LPCWSTR, msi_dialog*);
static VOID ControlEvent_CleanupDialogSubscriptions(MSIPACKAGE *package, LPWSTR dialog);
/* /*
* Create a dialog box and run it if it's modal * Create a dialog box and run it if it's modal
@ -123,7 +124,7 @@ static UINT ControlEvent_EndDialog(MSIPACKAGE* package, LPCWSTR argument,
package->CurrentInstallState = ERROR_FUNCTION_FAILED; package->CurrentInstallState = ERROR_FUNCTION_FAILED;
} }
ControlEvent_CleanupSubscriptions(package); ControlEvent_CleanupDialogSubscriptions(package, msi_dialog_get_name( dialog ));
msi_dialog_end_dialog( dialog ); msi_dialog_end_dialog( dialog );
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
@ -320,6 +321,23 @@ VOID ControlEvent_FireSubscribedEvent( MSIPACKAGE *package, LPCWSTR event,
} }
} }
static VOID ControlEvent_CleanupDialogSubscriptions(MSIPACKAGE *package, LPWSTR dialog)
{
struct list *i, *t;
struct subscriber *sub;
LIST_FOR_EACH_SAFE( i, t, &package->subscriptions )
{
sub = LIST_ENTRY( i, struct subscriber, entry );
if ( lstrcmpW( msi_dialog_get_name( sub->dialog ), dialog ))
continue;
list_remove( &sub->entry );
free_subscriber( sub );
}
}
VOID ControlEvent_CleanupSubscriptions(MSIPACKAGE *package) VOID ControlEvent_CleanupSubscriptions(MSIPACKAGE *package)
{ {
struct list *i, *t; struct list *i, *t;