From dd90dac0a00b4799a9de7564af30c8d36418826d Mon Sep 17 00:00:00 2001 From: SteveDraper Date: Fri, 25 Oct 2013 18:31:49 -0500 Subject: [PATCH 1/2] Adding cleanup method to allow LocalGameRepository to free resources cleanly Provides a mean for a client application to cause the local game repository server binding to be cleaned up reliably before exit --- src/org/ggp/base/util/game/LocalGameRepository.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/org/ggp/base/util/game/LocalGameRepository.java b/src/org/ggp/base/util/game/LocalGameRepository.java index e58584ebf..6521161da 100644 --- a/src/org/ggp/base/util/game/LocalGameRepository.java +++ b/src/org/ggp/base/util/game/LocalGameRepository.java @@ -47,8 +47,17 @@ public LocalGameRepository() { throw new RuntimeException(e); } } + theRealRepo = new RemoteGameRepository(theLocalRepoURL); } + + public void cleanUp() + { + if (theLocalRepoServer != null) { + theLocalRepoServer.stop(0); + } + + } @Override protected Game getUncachedGame(String theKey) { From c20eca0ed0ce50a3826b661a6a18db247eec8de5 Mon Sep 17 00:00:00 2001 From: SteveDraper Date: Fri, 25 Oct 2013 19:15:28 -0500 Subject: [PATCH 2/2] Removed spurious blank line --- src/org/ggp/base/util/game/LocalGameRepository.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/org/ggp/base/util/game/LocalGameRepository.java b/src/org/ggp/base/util/game/LocalGameRepository.java index 6521161da..00450a201 100644 --- a/src/org/ggp/base/util/game/LocalGameRepository.java +++ b/src/org/ggp/base/util/game/LocalGameRepository.java @@ -56,7 +56,6 @@ public void cleanUp() if (theLocalRepoServer != null) { theLocalRepoServer.stop(0); } - } @Override