Homec4science

Make AphrontWriteGuard disposal more durable

Authored by epriestley <git@epriestley.com> on May 14 2015, 19:39.

Description

Make AphrontWriteGuard disposal more durable

Summary:
Ref T8198. Currently, if you swap a write guard like this:

$write_guard->dispose();
$write_guard = new AphrontWriteGuard('callback');

...the second line does this:

  • Creates a new WriteGuard object.
  • Assigns it to self::$instance.
  • Invokes __destroy() on the old object.

At this point, we'll throw an exception, even though we disposed of the write guard properly.

Instead, flag write guard disposal explicitly to prevent this issue.

Test Plan: See next diff.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T8198

Differential Revision: https://secure.phabricator.com/D12841

Details

Committed
epriestley <git@epriestley.com>May 14 2015, 19:39
Pushed
aubortMar 17 2017, 12:03
Parents
rPHUf06c0b71f369: Add PhutilInvalidStateException class
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUdc4b8571f975: Make AphrontWriteGuard disposal more durable (authored by epriestley <git@epriestley.com>).May 14 2015, 19:39