--- ray/src/rt/freeobjmem.c 2003/02/25 02:47:22 2.5 +++ ray/src/rt/freeobjmem.c 2013/12/09 17:56:25 2.9 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: freeobjmem.c,v 2.5 2003/02/25 02:47:22 greg Exp $"; +static const char RCSid[] = "$Id: freeobjmem.c,v 2.9 2013/12/09 17:56:25 greg Exp $"; #endif /* * Free memory associated with object(s) @@ -11,16 +11,21 @@ static const char RCSid[] = "$Id: freeobjmem.c,v 2.5 2 #include "ray.h" #include "otypes.h" +#include "rtotypes.h" +#include "bsdf.h" #include "face.h" #include "cone.h" #include "instance.h" #include "data.h" #include "font.h" +#include "func.h" +#include "mesh.h" int -free_os(op) /* free unneeded memory for object */ -register OBJREC *op; +free_os( /* free unneeded memory for object */ + OBJREC *op +) { if (op->os == NULL) return(0); @@ -42,6 +47,9 @@ register OBJREC *op; case OBJ_INSTANCE: /* octree instance */ freeinstance(op); return(1); + case OBJ_MESH: /* mesh instance */ + freemeshinst(op); + return(1); case PAT_BTEXT: /* monochromatic text */ case PAT_CTEXT: /* colored text */ case MIX_TEXT: /* mixing text */ @@ -61,12 +69,13 @@ register OBJREC *op; int -free_objs(on, no) /* free some object structures */ -register OBJECT on; -OBJECT no; +free_objs( /* free some object structures */ + OBJECT on, + OBJECT no +) { int nfreed; - register OBJREC *op; + OBJREC *op; for (nfreed = 0; no-- > 0; on++) { op = objptr(on); @@ -78,9 +87,10 @@ OBJECT no; void -free_objmem() /* free all object cache memory */ +free_objmem(void) /* free all object cache memory */ { free_objs(0, nobjects); freedata(NULL); freefont(NULL); + SDfreeCache(NULL); }