Branch: Tag:

1998-04-16

1998-04-16 21:39:45 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

add_ref() added

Rev: src/interpret.c:1.78
Rev: src/modules/files/file.c:1.89
Rev: src/modules/files/socket.c:1.34
Rev: src/object.c:1.46
Rev: src/program.c:1.83
Rev: src/svalue.h:1.16

4:   ||| See the files COPYING and DISCLAIMER for more information.   \*/   #include "global.h" - RCSID("$Id: program.c,v 1.82 1998/04/16 01:23:03 hubbe Exp $"); + RCSID("$Id: program.c,v 1.83 1998/04/16 21:32:03 hubbe Exp $");   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"
417:    if((p->next=first_program)) first_program->prev=p;    first_program=p;    }else{ -  p->refs++; +  add_ref(p);    }       if(name)
457:    fake_object->parent=0;    fake_object->parent_identifier=0;    fake_object->prog=p; -  p->refs++; +  add_ref(p);       if(name)    {    if((fake_object->parent=previous_program_state->fake_object)) -  fake_object->parent->refs++; +  add_ref(fake_object->parent);    fake_object->parent_identifier=id;    }   
536:    for(e=0; e<p->num_constants; e++)    free_svalue(p->constants+e);    -  for(e=1; e<p->num_inherits; e++) +  for(e=0; e<p->num_inherits; e++)    {    if(p->inherits[e].name)    free_string(p->inherits[e].name);    if(e)    {    free_program(p->inherits[e].prog); -  +  }    if(p->inherits[e].parent)    free_object(p->inherits[e].parent);    } -  } +        if(p->prev)    p->prev->next=p->next;
816:    prog=0;    }else{    prog=new_program; -  prog->refs++; +  add_ref(prog);      #ifdef DEBUG    check_program(prog);
1045:    for(e=0; e<(int)p->num_inherits; e++)    {    inherit=p->inherits[e]; -  inherit.prog->refs++; +  add_ref(inherit.prog);    inherit.identifier_level += new_program->num_identifier_references;    inherit.storage_offset += storage_offset;    inherit.inherit_level ++;
1103:    inherit.parent_offset=0;    }    } -  if(inherit.parent) inherit.parent->refs++; +  if(inherit.parent) add_ref(inherit.parent);       if(name)    {
2233:    if(gc_do_free(p))    {    int e; -  p->refs++; +  add_ref(p);    free_svalues(p->constants, p->num_constants, -1);    for(e=0;e<p->num_inherits;e++)    {