Fixed issues introduced by my previous pull request

Memory leaks in DynamicRibbonWidget and ImageButtonWidget are now gone, and the crashes that appeared in the track info screen too.