Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@scutlight
Copy link
Member

@scutlight scutlight commented Jul 29, 2020

Description

Some codes miss use the WeakPtr API to check its validity. The API get() of WeakPtr just for returning the internal pointer, without checking the pointer's validity. To correct it, just use WeakPtr's operator bool().

Related Issues

none

Tests

I added the following tests:

Replace this with a list of the tests that you added as part of this PR. A
change in behaviour with no test covering it will likely get reverted
accidentally sooner or later. PRs must include tests for all
changed/updated/fixed behaviors. See testing the engine for instructions on
writing and running engine tests.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the contributor guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the C++, Objective-C, Java style guides for the engine.
  • I read the tree hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation.
  • All existing and new tests are passing.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read handling breaking changes.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@auto-assign auto-assign bot requested a review from chinmaygarde July 29, 2020 10:20
@scutlight scutlight force-pushed the pr/fix-usage-of-weak-ptr-valid-check branch from 86e6b64 to 8174e1d Compare August 7, 2020 02:07
@cbracken cbracken self-requested a review September 9, 2020 22:12
Copy link
Member

@cbracken cbracken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM in principle, but would like to get @blasten's thoughts with respect to dynamic thread merge/de-merging. If that scenario would be problematic for this patch we should probably add a test that would trigger this, and add comments where we're bypassing WeakPtr's thread-checking.

@cbracken
Copy link
Member

cbracken commented Sep 9, 2020

Thanks for the cleanup @scutlight!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants