Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 10392)
+++ wp-includes/post.php	(working copy)
@@ -2493,6 +2493,8 @@
 	$meta = wp_get_attachment_metadata( $postid );
 	$file = get_attached_file( $postid );
 
+	do_action('delete_attachment', $postid);
+
 	/** @todo Delete for pluggable post taxonomies too */
 	wp_delete_object_term_relationships($postid, array('category', 'post_tag'));
 
@@ -2529,8 +2531,6 @@
 
 	clean_post_cache($postid);
 
-	do_action('delete_attachment', $postid);
-
 	return $post;
 }
 

