From 2c83a950a414205f2ece4ab953ed993c10d2f537 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 23 Jul 2010 23:32:56 +0000 Subject: [PATCH] Store the result of wxWindow::NewControlId() in wxWindowIDRef. The result of calling NewControlId() must be assigned to wxWindowIDRef to be accounted for correctly, otherwise the id was marked as free while a reference to it still existed resulting in asserts in id management code when we attempted to reuse it. Closes #11604. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65059 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/scroll/scroll.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/samples/scroll/scroll.cpp b/samples/scroll/scroll.cpp index ef86c1791b..281ee38b92 100644 --- a/samples/scroll/scroll.cpp +++ b/samples/scroll/scroll.cpp @@ -652,13 +652,13 @@ public: // MyCanvas // ---------------------------------------------------------------------------- -const wxWindowID ID_ADDBUTTON = wxWindow::NewControlId(); -const wxWindowID ID_DELBUTTON = wxWindow::NewControlId(); -const wxWindowID ID_MOVEBUTTON = wxWindow::NewControlId(); -const wxWindowID ID_SCROLLWIN = wxWindow::NewControlId(); -const wxWindowID ID_QUERYPOS = wxWindow::NewControlId(); +const wxWindowIDRef ID_ADDBUTTON = wxWindow::NewControlId(); +const wxWindowIDRef ID_DELBUTTON = wxWindow::NewControlId(); +const wxWindowIDRef ID_MOVEBUTTON = wxWindow::NewControlId(); +const wxWindowIDRef ID_SCROLLWIN = wxWindow::NewControlId(); +const wxWindowIDRef ID_QUERYPOS = wxWindow::NewControlId(); -const wxWindowID ID_NEWBUTTON = wxWindow::NewControlId(); +const wxWindowIDRef ID_NEWBUTTON = wxWindow::NewControlId(); BEGIN_EVENT_TABLE(MyCanvas, wxScrolled) EVT_PAINT( MyCanvas::OnPaint) -- 2.45.2