HomePhabricator

Make AphrontWriteGuard disposal more durable

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

Provenance
epriestleyAuthored on
epriestleyPushed on May 14 2015, 5:39 PM
Reviewer
btrahan
Differential Revision
D12841: Make AphrontWriteGuard disposal more durable
Parents
rPHUf06c0b71f369: Add PhutilInvalidStateException class
Branches
Unknown
Tags
Unknown
Tasks
T8198: Unguarded write error on every page