Replace Connect() with Bind() in all samples and utils too
Still use Connect() in unit tests which were written explicitly for it and in EventConnector, which can't use Bind() as it uses a variable for the event type. No real changes, just use the newer and more convenient function.
This commit is contained in:
@@ -220,14 +220,14 @@ MyFrame::MyFrame()
|
||||
#endif // wxUSE_ACCEL
|
||||
|
||||
// connect it only now, after creating m_textWindow
|
||||
Connect(wxEVT_SIZE, wxSizeEventHandler(MyFrame::OnSize));
|
||||
Bind(wxEVT_SIZE, &MyFrame::OnSize, this);
|
||||
}
|
||||
|
||||
MyFrame::~MyFrame()
|
||||
{
|
||||
// and disconnect it to prevent accessing already deleted m_textWindow in
|
||||
// the size event handler if it's called during destruction
|
||||
Disconnect(wxEVT_SIZE, wxSizeEventHandler(MyFrame::OnSize));
|
||||
Unbind(wxEVT_SIZE, &MyFrame::OnSize, this);
|
||||
|
||||
// also prevent its use as log target
|
||||
delete wxLog::SetActiveTarget(NULL);
|
||||
|
Reference in New Issue
Block a user