Loading

Paste #pn4dd0t8d

  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.     }

Version history

Revision # Author Created at
psoqsx609 Anonymous 10 Aug 2015, 19:41:11 UTC Diff

Comments