Loading

Paste #psoqsx609

  1. Variant 1:
  2.     if (res == 0) {
  3.        try {
  4.            FinalRelease();
  5.        } catch (...) {
  6.            delete this;
  7.            throw;
  8.        }
  9.         delete this;
  10.     }
  11.  
  12.  
  13. Variant 2:
  14.     if (res == 0) {
  15.       std::auto_ptr<SimpleCountedObject> delete_after_throw = this;
  16.       FinalRelease(); // may throw, for example ScriptTest/ExecMode
  17.     }

Comments