Ignore:
Timestamp:
Aug 29, 2017, 10:52:39 AM (7 years ago)
Author:
djay
Message:

Fix various memory leaks and enhance the callback support. Add the prohibited keyword to the callback section to avoid calling callback for such services.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/prototype-v0/zoo-project/zoo-kernel/meta_sql.c

    r845 r850  
    144144      if(strlen(tmp)>0)
    145145        if(*ap==NULL){
    146           *ap=createMap(fields[i],tmp);
     146          (*ap)=createMap(fields[i],tmp);
    147147          addToMap(*ap,"fromDb","true");
    148148        }
     
    306306  // Extract metadata
    307307  fillMetadata(conf,&res->metadata,input->GetFieldAsString( 0 ));
     308  res->additional_parameters=NULL;
    308309  fillAdditionalParameters(conf,&res->additional_parameters,input->GetFieldAsString( 0 ));
    309310  res->defaults=NULL;
     
    401402      if(minimal==1){
    402403        OGRFeature::DestroyFeature( poFeature );
     404        cleanFetchSql(conf,0,res);
    403405        return s;
    404406      }
     
    410412      while( (input = inputs->GetNextFeature()) != NULL ){
    411413        elements* in=extractInput(conf,input);
    412         addToElements(&s->inputs,in);
    413         freeElements(&in);
    414         free(in);       
     414        if(in!=NULL){
     415          if(s->inputs==NULL)
     416            s->inputs=dupElements(in);
     417          else
     418            addToElements(&s->inputs,in);
     419          freeElements(&in);
     420          free(in);
     421        }
    415422        OGRFeature::DestroyFeature( input );
    416423      }
     
    424431      while( (output = outputs->GetNextFeature()) != NULL ){
    425432        elements* in=extractOutput(conf,output);
    426         addToElements(&s->outputs,in);
     433        if(s->outputs==NULL)
     434          s->outputs=dupElements(in);
     435        else
     436          addToElements(&s->outputs,in);
    427437        freeElements(&in);
    428438        free(in);
     
    463473    poFeature = res->GetNextFeature();
    464474    while( poFeature != NULL ){
    465       fprintf(stderr,"************************* %s %d\n\n",__FILE__,__LINE__);
    466       fflush(stderr);
    467475      service* s=extractServiceFromDb(conf,poFeature->GetFieldAsString( 1 ),minimal);
    468476#ifdef USE_HPC
    469477      addNestedOutputs(&s);
    470478#endif
    471       fprintf(stderr,"************************* %s %d\n\n",__FILE__,__LINE__);
    472       fflush(stderr);
    473       dumpMap(s->content);
    474       fprintf(stderr,"************************* %s %d\n\n",__FILE__,__LINE__);
    475       fflush(stderr);
    476479      func(reg,conf,doc,n,s);
    477       fprintf(stderr,"************************* %s %d\n\n",__FILE__,__LINE__);
    478       fflush(stderr);
    479480      freeService(&s);
    480       fprintf(stderr,"************************* %s %d\n\n",__FILE__,__LINE__);
    481       fflush(stderr);
    482481      free(s);
    483482      OGRFeature::DestroyFeature( poFeature );
    484483      poFeature = res->GetNextFeature();
    485484      result++;
    486       fprintf(stderr,"************************* %s %d\n\n",__FILE__,__LINE__);
    487       fflush(stderr);
    488     }
    489   }
    490   fprintf(stderr,"************************* %s %d\n\n",__FILE__,__LINE__);
    491   fflush(stderr);
     485    }
     486    cleanFetchSql(conf,0,res);
     487  }
    492488  return result;
    493489}
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png