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