From 837adaa92222a6cb6c9242e062358901929e09f8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 16 Sep 2004 22:06:55 +0000 Subject: [PATCH] don't assert if Update(m_maximum) is called twice (replaces patch 995186) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29163 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/progdlgg.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/generic/progdlgg.cpp b/src/generic/progdlgg.cpp index 9fb1aaa95b..b8c4bc3169 100644 --- a/src/generic/progdlgg.cpp +++ b/src/generic/progdlgg.cpp @@ -348,6 +348,15 @@ wxProgressDialog::Update(int value, const wxString& newmsg) if ( value == m_maximum ) { + if ( m_state == Finished ) + { + // ignore multiple calls to Update(m_maximum): it may sometimes be + // troublesome to ensure that Update() is not called twice with the + // same value (e.g. because of the rounding errors) and if we don't + // return now we're going to generate asserts below + return true; + } + // so that we return true below and that out [Cancel] handler knew what // to do m_state = Finished; -- 2.45.2