Fix potential delete behavior of guard
authorSubodh Iyengar <subodh@fb.com>
Mon, 21 Sep 2015 22:38:25 +0000 (15:38 -0700)
committerfacebook-github-bot-9 <folly-bot@fb.com>
Mon, 21 Sep 2015 23:20:17 +0000 (16:20 -0700)
commitae59a5e910d1091d6abc5d21708d4c3881e786b7
tree8873f0c51a28f786341a1ae5ebfb4e93c026bad6
parent9722033f9009b184b4c669cdc53e85e7567c482a
Fix potential delete behavior of guard

Summary: There is a potential double free in destructor guard
if someone calls a method which takes a DG in the destructor
of the DG.

This is potential in the case when someone is holding onto
a DG while calling destroy() on the object.

Reviewed By: @djwatson

Differential Revision: D2463113
folly/io/async/DelayedDestruction.h
folly/io/async/test/DelayedDestructionTest.cpp [new file with mode: 0644]