Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.262
diff -u -p -r1.262 system.admin.inc
--- modules/system/system.admin.inc	7 Mar 2010 07:36:27 -0000	1.262
+++ modules/system/system.admin.inc	11 Mar 2010 07:56:59 -0000
@@ -1384,6 +1384,9 @@ function system_modules_uninstall_submit
     drupal_set_message(t('The selected modules have been uninstalled.'));
 
     $form_state['redirect'] = 'admin/modules/uninstall';
+
+    // Synchronize to catch any actions that were removed.
+    actions_synchronize();
   }
   else {
     $form_state['storage'] = $form_state['values'];
Index: modules/trigger/trigger.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/trigger/trigger.install,v
retrieving revision 1.16
diff -u -p -r1.16 trigger.install
--- modules/trigger/trigger.install	4 Dec 2009 16:49:47 -0000	1.16
+++ modules/trigger/trigger.install	11 Mar 2010 07:56:59 -0000
@@ -43,11 +43,11 @@ function trigger_schema() {
 }
 
 /**
- * Implements hook_install().
+ * Implements hook_enable().
  */
-function trigger_install() {
-  // Do initial synchronization of actions in code and the database.
-  actions_synchronize();
+function trigger_enable() {
+  // Synchronize {trigger_assignments} table with a current set of actions.
+  db_query("DELETE FROM {trigger_assignments} WHERE aid NOT IN (SELECT aid FROM {actions})")->execute();
 }
 
 /**
Index: modules/trigger/trigger.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/trigger/trigger.test,v
retrieving revision 1.28
diff -u -p -r1.28 trigger.test
--- modules/trigger/trigger.test	7 Mar 2010 18:06:06 -0000	1.28
+++ modules/trigger/trigger.test	11 Mar 2010 07:56:59 -0000
@@ -401,6 +401,7 @@ class TriggerOrphanedActionsTestCase ext
     // Disable the module that provides the action and make sure the trigger
     // doesn't white screen.
     module_disable(array('trigger_test'));
+    variable_set('trigger_test_generic_any_action', FALSE);
     $loaded_node = $this->drupalGetNodeByTitle($edit["title"]);
     $edit["body[$langcode][0][value]"] = '!SimpleTest test body! ' . $this->randomName(32) . ' ' . $this->randomName(32);
     $this->drupalPost("node/$loaded_node->nid/edit", $edit, t('Save'));
@@ -408,5 +409,7 @@ class TriggerOrphanedActionsTestCase ext
     // If the node body was updated successfully we have dealt with the
     // unavailable action.
     $this->assertRaw(t('!post %title has been updated.', array('!post' => 'Basic page', '%title' => $edit["title"])), t('Make sure the Basic page can be updated with the missing trigger function.'));
+    // Action should not have been fired.
+    $this->assertFalse(variable_get('trigger_test_generic_any_action', FALSE), t('Trigger test action has not been fired.'));
   }
 }
