Commit e9ec6e17 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Cut DestructorGuard default ctor

Summary:
[Folly] Cut `DestructorGuard` default ctor. It does not actually need one, but its presence can hurt.

```lang=c++
void callback() {
  // compiles, which can hurt:
  DestructorGuard(delayed);

  // intended:
  DestructorGuard guard(delayed);
}
```

Reviewed By: lbrandy

Differential Revision: D10413329

fbshipit-source-id: f84eb0de0290cb09f7ac358044c2ef2d71dd8cea
parent 9d03fa29
...@@ -61,7 +61,7 @@ class DelayedDestructionBase : private boost::noncopyable { ...@@ -61,7 +61,7 @@ class DelayedDestructionBase : private boost::noncopyable {
*/ */
class DestructorGuard { class DestructorGuard {
public: public:
explicit DestructorGuard(DelayedDestructionBase* dd = nullptr) : dd_(dd) { explicit DestructorGuard(DelayedDestructionBase* dd) : dd_(dd) {
if (dd_ != nullptr) { if (dd_ != nullptr) {
++dd_->guardCount_; ++dd_->guardCount_;
assert(dd_->guardCount_ > 0); // check for wrapping assert(dd_->guardCount_ > 0); // check for wrapping
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment