Changeset 27221


Ignore:
Timestamp:
08/20/22 15:52:46 (3 years ago)
Author:
Eric.Larour
Message:

CHG: watchout to not wipe out a GenericParam object which is itself a pointer!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/branches/trunk-larour-SLPS2022/src/c/cores/sealevelchange_core.cpp

    r27218 r27221  
    708708void              sealevelchange_finalize(FemModel* femmodel) {  /*{{{*/
    709709
     710        bool isuq=false;
     711       
    710712        BarystaticContributions* barycontrib=NULL;
    711713        GenericParam<BarystaticContributions*>* barycontribparam=NULL;
    712714       
    713         /*Erase barycontrib object: */
    714         barycontribparam = xDynamicCast<GenericParam<BarystaticContributions*>*>(femmodel->parameters->FindParamObject(BarystaticContributionsEnum));
    715         barycontrib=barycontribparam->GetParameterValue();
    716         delete barycontrib;
     715        femmodel->parameters->FindParam(&isuq,QmuIsdakotaEnum);
     716
     717        if(isuq){
     718                //reset barycontrib object:
     719                barycontribparam = xDynamicCast<GenericParam<BarystaticContributions*>*>(femmodel->parameters->FindParamObject(BarystaticContributionsEnum));
     720                barycontrib=barycontribparam->GetParameterValue();
     721                barycontrib->Reset();
     722        }
     723        else {
     724                /*Erase barycontrib object: */
     725                barycontribparam = xDynamicCast<GenericParam<BarystaticContributions*>*>(femmodel->parameters->FindParamObject(BarystaticContributionsEnum));
     726                barycontrib=barycontribparam->GetParameterValue();
     727                delete barycontrib;
     728        }
    717729
    718730        return;
Note: See TracChangeset for help on using the changeset viewer.