Home GnuPG

Make AphrontWriteGuard disposal more durable
dc4b8571f975Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

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
epriestley <git@epriestley.com>Authored on May 14 2015, 7:39 PM
Parents
rPHUTILf06c0b71f369: Add PhutilInvalidStateException class
Branches
Unknown
Tags
Unknown

Event Timeline

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