diff --git a/src/main/java/org/jboss/netty/bootstrap/Bootstrap.java b/src/main/java/org/jboss/netty/bootstrap/Bootstrap.java index 5bdce89fb3..25ca73a4d8 100644 --- a/src/main/java/org/jboss/netty/bootstrap/Bootstrap.java +++ b/src/main/java/org/jboss/netty/bootstrap/Bootstrap.java @@ -34,6 +34,7 @@ import org.jboss.netty.channel.ChannelFactory; import org.jboss.netty.channel.ChannelHandler; import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.channel.ChannelPipelineFactory; +import org.jboss.netty.util.ExternalResourceReleasable; import org.jboss.netty.util.internal.MapUtil; /** @@ -50,7 +51,7 @@ import org.jboss.netty.util.internal.MapUtil; * * @apiviz.uses org.jboss.netty.channel.ChannelFactory */ -public class Bootstrap { +public class Bootstrap implements ExternalResourceReleasable { private volatile ChannelFactory factory; private volatile ChannelPipeline pipeline = pipeline(); @@ -264,4 +265,11 @@ public class Bootstrap { options.put(key, value); } } + + public void releaseExternalResources() { + ChannelFactory factory = this.factory; + if (factory != null) { + factory.releaseExternalResources(); + } + } }