]> git.saurik.com Git - wxWidgets.git/commitdiff
don't assert if Update(m_maximum) is called twice (replaces patch 995186)
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 16 Sep 2004 22:06:55 +0000 (22:06 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 16 Sep 2004 22:06:55 +0000 (22:06 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29163 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/progdlgg.cpp

index 9fb1aaa95b16249fce0a3d0e2e48ac19abb0a90a..b8c4bc316905b1fa0aecb4e055cfe8175d08043c 100644 (file)
@@ -348,6 +348,15 @@ wxProgressDialog::Update(int value, const wxString& newmsg)
 
     if ( value == m_maximum )
     {
 
     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;
         // so that we return true below and that out [Cancel] handler knew what
         // to do
         m_state = Finished;