edwards older son and heir was only 12 years old at the time of this premature death , and in his will the king had named his own younger brother richard , duke of gloucester , as protector of the realm .