Fix missing ResourceLeak.close() in AbstractDnsMessage

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
This commit is contained in:
Trustin Lee 2015-05-04 12:05:59 +09:00
parent 410aa427be
commit 3064e6dba8

View File

@ -375,6 +375,11 @@ public abstract class AbstractDnsMessage extends AbstractReferenceCounted implem
@Override
protected void deallocate() {
clear();
final ResourceLeak leak = this.leak;
if (leak != null) {
leak.close();
}
}
@Override