According to the post, after give_away, if the creating process dies, the process SomeOtherProcess will receive a message of the form {'ETS-TRANSFER', TableId, OldOwner, GiftData}
is wrong. When give_away/3 is called, immediately the SomeOtherProcess becomes new owner process and receives this message even if the creator is not dead.
As you told it is not really necessary to handle exit signal also, but you may want to do any other operations on receiving the exit message. (Also handling give_away chains, getting back the table back to creator from owner etc)
Usually what I have come across is that 'ETS-TRANSFER' message comes before 'EXIT' but we cannot reply on this. Hence as Roberto Aloi has mentioned, we can do selective receive. Selective receive is achieved using nesting receive. Example
receive
{'EXIT', Pid, Reason} ->
receive
{'ETS-TRANSFER', TableId, OldOwner, HeirData} ->
got_table
after 0 ->
ignore
end
after 0 ->
ignore
end.
LearnYouSomeErlang has good explanation of selective receive and why/how to avoid it to give priority to messages received.