C++ (Qt)Myslass::Myslass(QObject *parent) : QObject(parent), timer(0), notifier(0){ //Здесь могут происходить обломы std::auto_ptr<QTimer> timer = new QTimer(this); if (otherSomethingWrong) throw MyException(); std::auto_ptr<QSocketNotifier> notifier = new QSocketNotifier (this); .... //Здесь обломов уже быть не может this->timer = timer.release(); this->notifier = notifier.release();}