Skip to content

Commit

Permalink
Fix missing ResourceLeak.close() in AbstractDnsMessage
Browse files Browse the repository at this point in the history
Motivation:

ResourceLeak.close() must be called when a reference-counted resource is
deallocated, but AbstractDnsMessage.deallocate() forgot to call it.

Modifications:

Call ResourceLeak.close() for the tracked AbstractDnsMessage instances

Result:

Fix the false resource leak warnings
  • Loading branch information
trustin committed May 4, 2015
1 parent 9d70cf3 commit 5e0ee6c
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,11 @@ public DnsMessage retain(int increment) {
@Override
protected void deallocate() {
clear();

final ResourceLeak leak = this.leak;
if (leak != null) {
leak.close();
}
}

@Override
Expand Down

0 comments on commit 5e0ee6c

Please sign in to comment.