mardi 23 août 2016

How to call all destructors?

i have a big problem. When i throw an exception or call std::terminate or std::exit, the object destructor does not runs. Well this is the problem, my code is full of with this statements, because i was thinking this statements are calling destructor.

How i can solve this problem? I can not change the structure of the classes, i have 10K of code and many classes.

void Function(int Stage)
{
    switch (Stage)
    {
        case 0: 
            //Somehow call the destructors
            break;
        case 1:
            //initialize
            break;
        default:
           //Give an error message and call the destructors
   }
}

Aucun commentaire:

Enregistrer un commentaire