### Eclipse Workspace Patch 1.0
#P extranet-client
Index: src/drupal/modules/block/block.module
===================================================================
--- src/drupal/modules/block/block.module	(revision 276)
+++ src/drupal/modules/block/block.module	(working copy)
@@ -576,3 +576,10 @@
     return implode(':', $cid_parts);
   }
 }
+
+/**
+ * Implementation of hook role_delete
+ */
+function block_role_delete($rid) {
+  db_query('DELETE FROM {blocks_roles} WHERE rid = %d', $rid);
+}
Index: src/drupal/modules/user/user.admin.inc
===================================================================
--- src/drupal/modules/user/user.admin.inc	(revision 276)
+++ src/drupal/modules/user/user.admin.inc	(working copy)
@@ -694,7 +694,9 @@
     db_query('DELETE FROM {permission} WHERE rid = %d', $form_state['values']['rid']);
     // Update the users who have this role set:
     db_query('DELETE FROM {users_roles} WHERE rid = %d', $form_state['values']['rid']);
-
+    
+    module_invoke_all('role_delete', $form_state['values']['rid']);
+    
     drupal_set_message(t('The role has been deleted.'));
   }
   else if ($form_state['values']['op'] == t('Add role')) {
