Skip to content

Commit

Permalink
Merge pull request #1903 from newrelic/ning-fix
Browse files Browse the repository at this point in the history
Ning memory leak fix
  • Loading branch information
jasonjkeller authored May 20, 2024
2 parents cd3d269 + 2d93bed commit c20f632
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@ public void onThrowable(Throwable t) {
.build());
// This used to be segment.finish(t), but the agent doesn't automatically report it.
segment.end();
segment = null;
uri = null;
inboundHeaders = null;
responseStatus = null;
userAbortedOnStatusReceived = null;
}
responseStatus = null;
segment = null;
uri = null;
inboundHeaders = null;
userAbortedOnStatusReceived = null;

Weaver.callOriginal();
}

Expand Down Expand Up @@ -116,12 +117,12 @@ public T onCompleted() throws Exception {
.build());
//This used to be segment.finish(t), but the agent doesn't automatically report t.
segment.end();
segment = null;
uri = null;
inboundHeaders = null;
responseStatus = null;
userAbortedOnStatusReceived = null;
}
responseStatus = null;
segment = null;
uri = null;
inboundHeaders = null;
userAbortedOnStatusReceived = null;

return Weaver.callOriginal();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,13 @@ public void onThrowable(Throwable t) {
.build());
// This used to be segment.finish(t), but the agent doesn't automatically report it.
segment.end();
segment = null;
uri = null;
inboundHeaders = null;
responseStatus = null;
userAbortedOnStatusReceived = null;
}
responseStatus = null;
segment = null;
uri = null;
inboundHeaders = null;
userAbortedOnStatusReceived = null;

Weaver.callOriginal();
}

Expand Down Expand Up @@ -106,19 +107,18 @@ public T onCompleted() throws Exception {
.build());
//This used to be segment.finish(t), but the agent doesn't automatically report t.
segment.end();
segment = null;
uri = null;
inboundHeaders = null;
responseStatus = null;
userAbortedOnStatusReceived = null;
}
responseStatus = null;
segment = null;
uri = null;
inboundHeaders = null;
userAbortedOnStatusReceived = null;

return Weaver.callOriginal();
}

private Integer getStatusCode() {
if (responseStatus != null)
{
if (responseStatus != null) {
return responseStatus.getStatusCode();
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,13 @@ public void onThrowable(Throwable t) {
.build());
//This used to be segment.finish(t), but the agent doesn't automatically report t.
segment.end();
segment = null;
uri = null;
inboundHeaders = null;
responseStatus = null;
userAbortedOnStatusReceived = null;
}
segment = null;
uri = null;
inboundHeaders = null;
userAbortedOnStatusReceived = null;
responseStatus = null;

Weaver.callOriginal();
}

Expand Down Expand Up @@ -106,19 +107,18 @@ public T onCompleted() throws Exception {
.build());
// This used to be segment.finish(t), but the agent doesn't automatically report it.
segment.end();
segment = null;
uri = null;
inboundHeaders = null;
responseStatus = null;
userAbortedOnStatusReceived = null;
}
responseStatus = null;
segment = null;
uri = null;
inboundHeaders = null;
userAbortedOnStatusReceived = null;

return Weaver.callOriginal();
}

private Integer getStatusCode() {
if (responseStatus != null)
{
if (responseStatus != null) {
return responseStatus.getStatusCode();
}
return null;
Expand Down

0 comments on commit c20f632

Please sign in to comment.