Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.264
diff -u -p -r1.264 system.admin.inc
--- modules/system/system.admin.inc	28 Mar 2010 10:43:40 -0000	1.264
+++ modules/system/system.admin.inc	31 Mar 2010 02:21:52 -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	31 Mar 2010 02:21:52 -0000
@@ -43,11 +43,15 @@ 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.
+  $select = db_select('actions')
+    ->fields('actions', array('aid'));
+  db_delete('trigger_assignments')
+    ->condition('aid', $select, 'NOT IN')
+    ->execute();
 }
 
 /**
Index: modules/trigger/trigger.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/trigger/trigger.test,v
retrieving revision 1.30
diff -u -p -r1.30 trigger.test
--- modules/trigger/trigger.test	27 Mar 2010 18:32:06 -0000	1.30
+++ modules/trigger/trigger.test	31 Mar 2010 02:21:52 -0000
@@ -427,6 +427,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', 0);
     $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'));
@@ -434,5 +435,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', 0), t('Trigger test action has not been fired.'));
   }
 }
