In reply to Robert Trevellyan.

@robert, agree but for me it sounds like a call to a WC specific plugin (or a more genric one for when posts of any type are deleted) but it probably should happen when the post is deleted and things are still fresh in the memory of the admin, not 6 months later when it is hard to remember what was used where.

Another posibility is to limit attachment usage to specific content and than automatically remove them when the content is deleted, but this is almost for sure something that require support in core.