Looking from a Buddhist perspective, attachment would relate to desire, or lust, or clinging. It is the latter that creates suffering, and misery, in the form of a desire, or lust to keep and perpetuate that which is not sustainable; include life - which we each know is unsustainable. Ultimately it is not the death of a person that causes pain, rather the attempt to sustain that person. This pain is not the grief of their dying. Grief is the lament for their dying that unfortunately so often is consumed by the attachment - the clinging - to that which has gone. We each may act as the Speaker For The Dead when someone dies. This involves the acknowledging of this person with honest reflection that speaks of all aspects of the person. So, this is not a case of 'speaking ill of the dead' rather an honest appraisal of both their faults and and their virtues; along with a recognition and recounting of our own interactions of joy and sorrow.
Attachment is most often about the memory, the what was. The memories can be treasured and enjoyed as much as they might be rejected and be distasteful; but so often there remains an attachment to the past experiences. To work on letting go of both the pleasure and pain of the past experiences releases you to a choice to recount a memory; to learn and grow; and to live the pleasure and pain of the present experience more fully.