GRASS GIS 7 Programmer's Manual  7.0.4(2016)-r00000
segment/release.c
Go to the documentation of this file.
1 
15 #include <stdlib.h>
16 #include <grass/gis.h>
17 #include "local_proto.h"
18 
19 
36 int Segment_release(SEGMENT * SEG)
37 {
38  int i;
39 
40  if (SEG->open != 1)
41  return -1;
42 
43  for (i = 0; i < SEG->nseg; i++)
44  G_free(SEG->scb[i].buf);
45  G_free(SEG->scb);
46 
47  G_free(SEG->freeslot);
48  G_free(SEG->agequeue);
49  G_free(SEG->load_idx);
50 
51  SEG->open = 0;
52 
53  return 1;
54 }
int Segment_release(SEGMENT *SEG)
Free memory allocated to segment.
void G_free(void *buf)
Free allocated memory.
Definition: alloc.c:149