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, Apr 15, 10:35 AM
Unknown Object (File)
Thu, Apr 11, 10:33 AM
Unknown Object (File)
Apr 3 2024, 9:21 PM
Unknown Object (File)
Apr 2 2024, 5:44 AM
Unknown Object (File)
Mar 31 2024, 8:03 PM
Unknown Object (File)
Mar 23 2024, 12:44 PM
Unknown Object (File)
Mar 5 2024, 2:23 PM
Unknown Object (File)
Feb 22 2024, 6:50 PM
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.