Example usage for io.netty.util ReferenceCounted release

List of usage examples for io.netty.util ReferenceCounted release

Introduction

In this page you can find the example usage for io.netty.util ReferenceCounted release.

Prototype

boolean release();

Source Link

Document

Decreases the reference count by 1 and deallocates this object if the reference count reaches at 0 .

Usage

From source file:io.grpc.alts.internal.AltsChannelCrypterTest.java

License:Apache License

@After
public void tearDown() throws GeneralSecurityException {
    for (ReferenceCounted reference : references) {
        reference.release();
    }//from  w  w  w . j  a v a2  s.co m
    references.clear();
    client.destroy();
    server.destroy();
    // Increase our chances to detect ByteBuf leaks.
    GcFinalization.awaitFullGc();
}

From source file:io.grpc.alts.internal.AltsTsiFrameProtectorTest.java

License:Apache License

@After
public void teardown() {
    for (ReferenceCounted reference : references) {
        reference.release();
    }/*  w  w  w  . j ava  2 s .  c o  m*/
    references.clear();
    // Increase our chances to detect ByteBuf leaks.
    GcFinalization.awaitFullGc();
}

From source file:io.grpc.alts.internal.AltsTsiTest.java

License:Apache License

@After
public void tearDown() {
    for (ReferenceCounted reference : references) {
        reference.release();
    }//from  w  w w .j a v  a 2 s. co  m
    references.clear();
    // Increase our chances to detect ByteBuf leaks.
    GcFinalization.awaitFullGc();
}

From source file:org.atmosphere.nettosphere.BridgeRuntime.java

License:Apache License

@Override
public void channelRead(final ChannelHandlerContext ctx, final Object messageEvent)
        throws URISyntaxException, IOException {
    try {/*from www  . j a  va2s .co m*/
        handleMessageEvent(ctx, messageEvent);
    } finally {
        if (messageEvent instanceof ReferenceCounted) {
            ReferenceCounted refMsg = (ReferenceCounted) messageEvent;
            if (refMsg.refCnt() > 0)
                refMsg.release();
        }
    }
}

From source file:org.lanternpowered.server.network.message.ReferenceCountedMessage.java

License:MIT License

@Override
public boolean release() {
    final ReferenceCounted referenceCounted = getReferenceCounted();
    return referenceCounted == null || referenceCounted.release();
}