(LegendPanel.Destroy): New. Cleans up when then window is told to close. (LegendTree._OnMsgLayerChanged): Fixes a seg fault bug. See comment in source for more info.