Page MenuHomePhabricator

Make AphrontWriteGuard disposal more durable
ClosedPublic

Authored by epriestley on May 14 2015, 5:14 PM.
Tags
None
Referenced Files
F14031047: D12841.diff
Sat, Nov 9, 9:04 AM
F13984129: D12841.id.diff
Sun, Oct 20, 11:09 AM
F13975371: D12841.id.diff
Oct 18 2024, 9:52 AM
F13971877: D12841.id30885.diff
Oct 17 2024, 3:49 PM
Unknown Object (File)
Sep 18 2024, 9:46 PM
Unknown Object (File)
Sep 4 2024, 5:34 AM
Unknown Object (File)
Aug 31 2024, 6:15 PM
Unknown Object (File)
Aug 31 2024, 12:12 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.