The example that PolyHedral provided is the same one that I commonly use, so he has said much of how I would have said in response to this. I'll still say it in my own words, I suppose.
Windows 7, or any software basically, is just a series of calculations performed by the hardware of the computer. The software is an emergent property of the computer, and only exists as long as the hardware remains in the correct organized manner. The same is true for computer memory- the saved information is saved in the form of organized hardware.
If a computer is smashed to bits, or if it overheats and burns itself, or if water is poured all over it and short circuits it, or if the computer simply becomes very aged and the connections falter, then the software will cease to work. If the computer is irrevocably damaged, the software doesn't "fly out", but rather simply ceases to exist. The software is a purely emergent property of the hardware and is dependent on a specific organization of the hardware. When that organization no longer exists, the software no longer exists. If the computer is irrevocably damaged, then it will be impossible to repair and the memory will be lost forever.
Consider as an example a jigsaw puzzle. When I put a jigsaw puzzle together, it will be a complete picture. If, however, I take the puzzle apart and even destroy the pieces, then the picture doesn't "fly out" anywhere. It simply ceases to exist because it was only existent when the pieces were existent and organized properly.
The brain can conceivably be considered the same unless some sort of soul can be shown to exist or if its necessity is proven. The mind exists because the brain is constantly performing work. If the brain is damaged to a certain extent, then it will be unable to perform the functions that lead to a mind and to consciousness/awareness. It can also be damaged to a point where it begins acting differently such that the personality changes.
In this way, the mind can be an emergent property of the brain, just like how Windows 7 is an emerges from the computer or how a picture emerges from a completed jigsaw puzzle. When the brain dies, the mind or the self doesn't necessarily fly out anywhere; it may just cease to exist because the parts that made it up cease to exist in the proper organized form.