Page MenuHomePhabricator

Make AphrontWriteGuard disposal more durable
ClosedPublic

Authored by epriestley on May 14 2015, 5:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 3, 6:19 AM
Unknown Object (File)
Sun, Feb 9, 6:32 PM
Unknown Object (File)
Sat, Feb 8, 4:32 AM
Unknown Object (File)
Sat, Feb 8, 4:32 AM
Unknown Object (File)
Sat, Feb 8, 4:32 AM
Unknown Object (File)
Jan 30 2025, 5:12 AM
Unknown Object (File)
Jan 27 2025, 10:41 PM
Unknown Object (File)
Jan 25 2025, 8: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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.