[colossus] Fix server hangs when applying carry over damage

Bruno Wolff III bruno at fedoraproject.org
Thu Feb 14 00:55:16 UTC 2013


commit 40823bd644d318a3c78cacf0f204a812f1e76ad2
Author: Bruno Wolff III <bruno at wolff.to>
Date:   Wed Feb 13 18:54:00 2013 -0600

    Fix server hangs when applying carry over damage
    
    This problem has been in colossus for a long time, but didn't
    seem to actually cause a problem until recent java updates.

 colossus.spec |    8 +++++++-
 hang.patch    |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+), 1 deletions(-)
---
diff --git a/colossus.spec b/colossus.spec
index 731dfa9..bd967fd 100644
--- a/colossus.spec
+++ b/colossus.spec
@@ -3,7 +3,7 @@ Name:           colossus
 %global         revdate    20120314
 Version:        0.13.2
 %global         branch     0.13.x
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        Allows people to play Titan against each other or AIs
 
 Group:          Amusements/Games
@@ -21,6 +21,8 @@ URL:            http://colossus.sourceforge.net/
 Source0:        colossus-%{branch}-%{revdate}-%{rev}.tar.gz
 Source1:        colossus-gen-tarball.sh
 Source2:        colossus-rev.xsl
+# Backport carryover hang patch from upstream trunk
+Patch0:         hang.patch
 
 BuildArch:      noarch
 
@@ -59,6 +61,7 @@ This package contains the API documentation for %{name}.
 %setup -q -n %{name}-%{branch}-%{revdate}-%{rev}
 # With 0.13.x there is an extra direcory level
 mv Colossus/* Colossus/.??* .
+%patch0 -p2
 
 %build
 
@@ -154,6 +157,9 @@ touch --no-create %{_datadir}/pixmaps || :
 %{_javadocdir}/%{name}
 
 %changelog
+* Wed Feb 13 2013 Bruno Wolff III <bruno at wolff.to> - 0.13.2-4
+- Fix hang on applying carry over damage
+
 * Wed Feb 13 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.13.2-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
 
diff --git a/hang.patch b/hang.patch
new file mode 100644
index 0000000..0afe6ec
--- /dev/null
+++ b/hang.patch
@@ -0,0 +1,52 @@
+# From http://colossus.svn.sourceforge.net/viewvc/colossus?view=revision&revision=5300
+--- trunk/Colossus/core/src/main/java/net/sf/colossus/gui/ClientGUI.java	2012/12/24 01:44:32	5299
++++ trunk/Colossus/core/src/main/java/net/sf/colossus/gui/ClientGUI.java	2013/02/13 20:17:46	5300
+@@ -1753,8 +1753,37 @@
+         }
+     }
+ 
++    /** Dispose the PickCarryDialog, make sure that that is done inside the
++     *  EDT (caused GUI to hang in 1.6.0_39 whereas in 1.6.0_38 it worked )-;
++     */
+     public void disposePickCarryDialog()
+     {
++        if (SwingUtilities.isEventDispatchThread())
++        {
++            actualDisposePickCarryDialog();
++        }
++        else
++        {
++            try
++            {
++                SwingUtilities.invokeAndWait(new Runnable()
++                {
++                    public void run()
++                    {
++                        actualDisposePickCarryDialog();
++                    }
++                });
++            }
++            catch (Exception e)
++            {
++                LOGGER.warning("When trying to run disposePickCarryDialog "
++                    + "in invokeAndWait, caught exception: " + e);
++            }
++        }
++    }
++
++    public void actualDisposePickCarryDialog()
++    {
+         if (pickCarryDialog != null)
+         {
+             if (battleBoard != null)
+--- trunk/Colossus/core/src/main/java/net/sf/colossus/gui/PickCarry.java	2012/12/24 01:44:32	5299
++++ trunk/Colossus/core/src/main/java/net/sf/colossus/gui/PickCarry.java	2013/02/13 20:17:46	5300
+@@ -133,7 +133,7 @@
+             gui.getCallbackHandler().applyCarries(targetHex);
+         }
+         saveWindow.saveLocation(getLocation());
+-        dispose();
++        gui.disposePickCarryDialog();
+     }
+ 
+ }


More information about the scm-commits mailing list