ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/freeobjmem.c
(Generate patch)

Comparing ray/src/rt/freeobjmem.c (file contents):
Revision 2.2 by greg, Wed Feb 10 12:51:40 1993 UTC vs.
Revision 2.6 by greg, Thu Jul 10 03:47:00 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1992 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Free memory associated with object(s)
6 + *
7 + * External symbols declared in ray.h
8   */
9  
10 < #include "standard.h"
11 < #include "object.h"
10 > #include "copyright.h"
11 >
12 > #include "ray.h"
13   #include "otypes.h"
14 + #include "face.h"
15 + #include "cone.h"
16 + #include "instance.h"
17 + #include "data.h"
18 + #include "font.h"
19  
20  
21   int
# Line 37 | Line 42 | register OBJREC        *op;
42          case OBJ_INSTANCE:      /* octree instance */
43                  freeinstance(op);
44                  return(1);
45 +        case OBJ_MESH:          /* mesh instance */
46 +                freemeshinst(op);
47 +                return(1);
48          case PAT_BTEXT:         /* monochromatic text */
49          case PAT_CTEXT:         /* colored text */
50          case MIX_TEXT:          /* mixing text */
51                  freetext(op);
52                  return(1);
53          case MAT_CLIP:          /* clipping surface */
54 <                free(op->os);
54 >        case MAT_SPOT:          /* spot light source */
55 >                free((void *)op->os);
56                  op->os = NULL;
57                  return(1);
58 <        case MAT_SPOT:          /* spot light source */
50 <                return(0);
51 <        default:
58 >        }
59   #ifdef DEBUG
60 <                objerror(op, WARNING, "cannot free structure");
60 >        objerror(op, WARNING, "cannot free structure");
61   #endif
62 <                return(0);
56 <        }
62 >        return(0);
63   }
64  
65  
# Line 74 | Line 80 | OBJECT no;
80   }
81  
82  
83 + void
84   free_objmem()                   /* free all object cache memory */
85   {
86          free_objs(0, nobjects);
87          freedata(NULL);
81        freepict(NULL);
88          freefont(NULL);
89   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines