By demanding the attention of Sofia at the expense of the child he is creating the same for the child as he had from his mother.
In other words Erik s need for attention is so child like(fearful) it strikes me that he too may have been denied precious moments from his mother.
Grown ups that have been denied true love as a children behave in emotionally distorted ways. Some adults fearful of losing their partners will accommodate this form of behaviour at the risk of disturbing their family. They all end up as Eriks, denied early bonding with mother and they then grow to become needy fairweather adults, who in turn seek partners who are willing to deny their children.