Skip to content

Commit

Permalink
Use ReferenceCountUtil.release() istead of ReferenceCountUtil.safeRel…
Browse files Browse the repository at this point in the history
…ease() (#3797)

Related to #3792
  • Loading branch information
hangc0276 committed Mar 1, 2023
1 parent 73b0b9f commit 79fe6e9
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -984,9 +984,9 @@ public void setExplicitLac(ByteBuf entry, WriteCallback writeCallback, Object ct
stateManager.transitionToReadOnlyMode();
throw new IOException(e);
} finally {
ReferenceCountUtil.safeRelease(entry);
ReferenceCountUtil.release(entry);
if (explicitLACEntry != null) {
ReferenceCountUtil.safeRelease(explicitLACEntry);
ReferenceCountUtil.release(explicitLACEntry);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public synchronized void close() throws IOException {
if (closed) {
return;
}
ReferenceCountUtil.safeRelease(writeBuffer);
ReferenceCountUtil.release(writeBuffer);
fileChannel.close();
closed = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public void recycle() {
ledgerId = -1;
entryId = -1;
masterKey = null;
ReferenceCountUtil.safeRelease(data);
ReferenceCountUtil.release(data);
data = null;
recyclerHandle.recycle(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)
ctx.write(bx.retainedDuplicate(), i == (buffersCount - 1) ? promise : ctx.voidPromise());
}
} finally {
ReferenceCountUtil.safeRelease(b);
ReferenceCountUtil.release(b);
}
} else {
ctx.write(msg, promise);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,25 +303,25 @@ public ChannelFuture deregister(ChannelPromise promise) {

@Override
public ChannelFuture write(Object msg) {
ReferenceCountUtil.safeRelease(msg);
ReferenceCountUtil.release(msg);
return null;
}

@Override
public ChannelFuture write(Object msg, ChannelPromise promise) {
ReferenceCountUtil.safeRelease(msg);
ReferenceCountUtil.release(msg);
return null;
}

@Override
public ChannelFuture writeAndFlush(Object msg, ChannelPromise promise) {
ReferenceCountUtil.safeRelease(msg);
ReferenceCountUtil.release(msg);
return null;
}

@Override
public ChannelFuture writeAndFlush(Object msg) {
ReferenceCountUtil.safeRelease(msg);
ReferenceCountUtil.release(msg);
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ private void readEntriesFromReadAheadCache(PendingReadRequest nextRequest) {
return;
}
} finally {
ReferenceCountUtil.safeRelease(removedEntry);
ReferenceCountUtil.release(removedEntry);
}
} else if (skipBrokenEntries && BKException.Code.DigestMatchException == entry.getRc()) {
// skip this entry and move forward
Expand Down

0 comments on commit 79fe6e9

Please sign in to comment.