Author: dkulp Date: Fri Sep 13 18:39:21 2013 New Revision: 1523052 URL: http://svn.apache.org/r1523052 Log: Merged revisions 1513861 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes
........ r1513861 | amichai | 2013-08-14 09:03:55 -0400 (Wed, 14 Aug 2013) | 10 lines Merged revisions 1513793 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/trunk ........ r1513793 | amichai | 2013-08-14 13:03:55 +0300 (Wed, 14 Aug 2013) | 2 lines [CXF-5188] Fix resource leak when server fails to start ........ ........ Modified: cxf/branches/2.6.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java Modified: cxf/branches/2.6.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java?rev=1523052&r1=1523051&r2=1523052&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java (original) +++ cxf/branches/2.6.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java Fri Sep 13 18:39:21 2013 @@ -201,7 +201,12 @@ public class ServerFactoryBean extends A : getServiceClass()); if (start) { - server.start(); + try { + server.start(); + } catch (RuntimeException re) { + server.destroy(); // prevent resource leak + throw re; + } } return server; } finally {
