Hedda Gabler is not the only play of Henrick Ibsen's that ends in a death or suicide. Often, the motivation behind the action is a sense of a character being trapped in a situation from which there is no escape.
Although some people find Hedda Gabler an unsympathetic character, one can also say that as the daughter of an aristocrat, who early in her life got to enjoy riding and hunting and a more active and less constrained life than that of a bourgeois woman, Hedda feels trapped in an almost visceral sense in her marriage. The way she physically moves around is almost like that of a lioness prowling in a small cage. Her final suicide, by means of a gun, signifies both that for a woman of her period, there was no way to enjoy the sort of freedom she craved, and that the gun, symbolic of the freedoms of her girlhood, gives her the only freedom she can enjoy as a woman married in a bourgeois household, that of death.