TabControl: bug in removeTab
Posted: Tue May 13, 2008 21:06
I'm not sure where the proper place is to report this:
When a window is added to a tab control (addTab), the window subscribes to EventTextChanged, with a member function of the tab control as the handler. When it is removed from the tab control (removeTab), this event handler is not removed from the window.
This prevents renaming the window once it has been removed from a tab. It could also cause a crash if the tab has been deleted.
The simplest solution I see is if the tab control keeps a mapping of window pointers to Event::Connections and uses this to disconnect the handler when removing a tab.
When a window is added to a tab control (addTab), the window subscribes to EventTextChanged, with a member function of the tab control as the handler. When it is removed from the tab control (removeTab), this event handler is not removed from the window.
This prevents renaming the window once it has been removed from a tab. It could also cause a crash if the tab has been deleted.
The simplest solution I see is if the tab control keeps a mapping of window pointers to Event::Connections and uses this to disconnect the handler when removing a tab.