+ FreeStyles();
+
+ // notify the frame that it doesn't have a status bar any longer to avoid
+ // dangling pointers
+ wxFrame *frame = wxDynamicCast(GetParent(), wxFrame);
+ if ( frame && frame->GetStatusBar() == this )
+ {
+ frame->SetStatusBar(NULL);
+ }