Page MenuHomePhabricator

Make AphrontWriteGuard disposal more durable
ClosedPublic

Authored by epriestley on May 14 2015, 5:14 PM.
Tags
None
Referenced Files
F20041267: D12841.diff
Sat, May 30, 10:35 PM
Unknown Object (File)
Mar 21 2026, 7:32 PM
Unknown Object (File)
Feb 10 2026, 12:44 PM
Unknown Object (File)
Feb 6 2026, 12:27 AM
Unknown Object (File)
Feb 5 2026, 4:45 AM
Unknown Object (File)
Jan 12 2026, 3:13 PM
Unknown Object (File)
Dec 17 2025, 2:51 AM
Unknown Object (File)
Dec 1 2025, 10:37 AM
Subscribers

Details

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.

Diff Detail

Repository
rPHU libphutil
Branch
wg1
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 5980
Build 6000: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

epriestley retitled this revision from to Make AphrontWriteGuard disposal more durable.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
btrahan edited edge metadata.
This revision is now accepted and ready to land.May 14 2015, 5:23 PM
This revision was automatically updated to reflect the committed changes.