Ignore:
Timestamp:
Jun 27, 2014, 1:14:39 AM (10 years ago)
Author:
djay
Message:

Remove memory leaks from ZOO-Kernel. Fix issue #99.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/service.h

    r474 r490  
    6161#include <string.h>
    6262#ifndef WIN32
     63#ifndef bool
    6364#define bool int
     65#endif
     66#ifndef true
    6467#define true 1
    6568#define false -1
     69#endif
    6670#else
    6771  //#include <stdbool.h>
     
    422426    if(hasKey(m,n)==false){
    423427      map* _cursor=m;
    424       if(_cursor->next!=NULL){
    425         addToMap(_cursor->next,n,v);
    426       }else
    427         _cursor->next=createMap(n,v);
     428      while(_cursor->next!=NULL){
     429        _cursor=_cursor->next;
     430      }
     431      _cursor->next=createMap(n,v);
    428432    }
    429433    else{
     
    478482  }
    479483
    480   static map* getMapOrFill(map** m,const char *key,char* value){
     484  static map* getMapOrFill(map** m,const char *key,const char* value){
    481485    map* tmp=*m;
    482486    map* tmpMap=getMap(tmp,key);
    483487    if(tmpMap==NULL){
    484       if(tmp!=NULL)
    485         addToMap(*m,key,value);
     488      if(tmp!=NULL){
     489        addToMap((*m),key,value);
     490      }
    486491      else
    487492        (*m)=createMap(key,value);
     
    580585  }
    581586
    582   static map* getMapArray(map* m,char* key,int index){
     587  static map* getMapArray(map* m,const char* key,int index){
    583588    char tmp[1024];
    584589    if(index>0)
     
    659664    addToMap(_cursor->content,"length",tmpLen);
    660665    int i=0;
    661     map* tmpSizeI=getMap(tmp->content,tmpV[i]);
    662666    for(i=0;i<8;i++){
    663667      map* tmpVI=getMap(tmp->content,tmpV[i]);
     
    887891
    888892  static void dumpServiceAsYAML(service* s){
    889     int level=0;
    890893    int i;
    891894    fprintf(stderr,"# %s\n\n",s->name);
     
    905908    }
    906909    if(s->inputs!=NULL){
    907       fprintf(stderr,"\ninputs:\n",s->name);
     910      fprintf(stderr,"\ninputs:\n");
    908911      dumpElementsAsYAML(s->inputs);
    909912    }
    910913    if(s->outputs!=NULL){
    911       fprintf(stderr,"\noutputs:\n",s->name);
     914      fprintf(stderr,"\noutputs:\n");
    912915      dumpElementsAsYAML(s->outputs);
    913916    }
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