Branch: Tag:

2001-06-19

2001-06-19 22:11:59 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Clean up references as soon as they're not needed anymore.

Rev: src/builtin.cmod:1.41

1:   /* -*- c -*- -  * $Id: builtin.cmod,v 1.40 2001/06/19 21:46:13 grubba Exp $ +  * $Id: builtin.cmod,v 1.41 2001/06/19 22:11:59 grubba Exp $    */      #include "global.h"
698:    if (!THIS->filename) {    THIS->filename =    make_shared_string(get_line(THIS->pc, THIS->prog, &THIS->lineno)); +  if (THIS->prog) { +  free_program(THIS->prog); +  THIS->prog = NULL;    } -  +  }    ref_push_string(THIS->filename);    push_text(":");    push_int(THIS->lineno);
792:    THIS->filename =    make_shared_string(get_line(THIS->pc, THIS->prog,    &THIS->lineno)); +  if (THIS->prog) { +  free_program(THIS->prog); +  THIS->prog = NULL;    } -  +  }    ref_push_string(THIS->filename);    } else {    push_int(0);
804:    THIS->filename =    make_shared_string(get_line(THIS->pc, THIS->prog,    &THIS->lineno)); +  if (THIS->prog) { +  free_program(THIS->prog); +  THIS->prog = NULL;    } -  +  }    push_int(THIS->lineno);    } else {    push_int(0);