Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request.finish() may pass useless string to MarkerLog #115

Closed
joebowbeer opened this issue Nov 4, 2017 · 2 comments
Closed

Request.finish() may pass useless string to MarkerLog #115

joebowbeer opened this issue Nov 4, 2017 · 2 comments
Milestone

Comments

@joebowbeer
Copy link
Contributor

In Request.finish(), the Runnable is calling toString on itself instead of the Request object:

    mainThread.post(new Runnable() {
        @Override
        public void run() {
            mEventLog.add(tag, threadId);
            mEventLog.finish(this.toString());
        }
    });

Should be Request.this.toString()

Also, it would be more robust and leak-resistant if this Runnable were a static nested class that held no reference to the outer Request instance.

@jpd236
Copy link
Collaborator

jpd236 commented Nov 6, 2017

This will be resolved by #112, which I plan to merge after cutting 1.1.0 final.

It would probably be reasonable to grab the string up front to avoid leaking a reference to the Request, but ultimately this is debug only code (gated by MarkerLog.ENABLED) and any leak would be very short lived since it's just a quick runnable posted to the main thread.

@jpd236 jpd236 added this to the 1.1.1 milestone Nov 6, 2017
@jpd236
Copy link
Collaborator

jpd236 commented Dec 4, 2017

#112 is merged.

@jpd236 jpd236 closed this as completed Dec 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@joebowbeer @jpd236 and others