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

Alexandre Julliard julliard at wine.codeweavers.com
Mon Dec 18 05:34:36 CST 2006


Module: wine
Branch: master
Commit: 6f3f2549c1ec366b7ed46f4a2221194291e0d77d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6f3f2549c1ec366b7ed46f4a2221194291e0d77d

Author: James Hawkins <truiken at gmail.com>
Date:   Mon Dec 18 01:48:25 2006 -0600

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

---

 dlls/msi/events.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/dlls/msi/events.c b/dlls/msi/events.c
index 13805a6..c946512 100644
--- a/dlls/msi/events.c
+++ b/dlls/msi/events.c
@@ -54,6 +54,7 @@ struct subscriber {
 };
 
 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
@@ -123,7 +124,7 @@ static UINT ControlEvent_EndDialog(MSIPA
         package->CurrentInstallState = ERROR_FUNCTION_FAILED;
     }
 
-    ControlEvent_CleanupSubscriptions(package);
+    ControlEvent_CleanupDialogSubscriptions(package, msi_dialog_get_name( dialog ));
     msi_dialog_end_dialog( dialog );
     return ERROR_SUCCESS;
 }
@@ -320,6 +321,23 @@ VOID ControlEvent_FireSubscribedEvent( M
     }
 }
 
+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)
 {
     struct list *i, *t;




More information about the wine-cvs mailing list