IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40782


Ignore:
Timestamp:
Jun 6, 2019, 5:21:43 PM (7 years ago)
Author:
eugene
Message:

free memory on exit

Location:
branches/eam_branches/ohana.20190329/src/kapa2
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20190329/src/kapa2/include/prototypes.h

    r40781 r40782  
    33int           args                PROTO((int *argc, char **argv));
    44void          SetUpGraphic        PROTO((int *argc, char **argv));
     5void          FreeGraphic         PROTO((void));
    56void          DefineLayout        PROTO((int, char **));
    67int           EventLoop           PROTO((void));
     
    2930void          MapWindow           PROTO((Graphic *graphic));
    3031void          CheckVisual         PROTO((Graphic *graphic, int *argc, char **argv));
    31 void          FreeVisual          PROTO((Graphic *graphic));
    3232
    3333/* X drawing utilities */
     
    116116
    117117void          InitLayout          PROTO((int argc, char **argv));
     118void          FreeLayout          PROTO((void));
    118119
    119120/* PS drawing utilities */
  • branches/eam_branches/ohana.20190329/src/kapa2/src/CheckVisual.c

    r40781 r40782  
    195195  }
    196196}
    197 
    198 void FreeVisual (Graphic *graphic) {
    199   free (graphic[0].pixels);
    200   free (graphic[0].cmap);
    201 }
  • branches/eam_branches/ohana.20190329/src/kapa2/src/Layout.c

    r35237 r40782  
    4545  AddSection ("default", 0.0, 0.0, 1.0, 1.0, -1);
    4646}
     47
     48void FreeLayout (void) {
     49  FreeSections ();
     50  FreeRotFonts ();
     51}
  • branches/eam_branches/ohana.20190329/src/kapa2/src/LoadLabels.c

    r39577 r40782  
    2626  label[Nbytes] = 0;
    2727 
     28  FREE (label);
     29
    2830  c = GetRotFont (&size);
    2931
  • branches/eam_branches/ohana.20190329/src/kapa2/src/SetUpGraphic.c

    r40731 r40782  
    3232  graphic->pixels       = NULL;
    3333
     34  graphic->smooth_sigma = 0.0;
     35
    3436  if (!USE_XWINDOW) {
    3537    ALLOCATE (graphic[0].pixels, unsigned long, NPIXELS_STATIC);
     
    5052  CheckVisual (graphic, argc, argv);
    5153  CheckColors (graphic, argc, argv);
    52 
    53   graphic->smooth_sigma = 0.0;
    5454
    5555  icon.width = icon_width;
     
    9797  return TRUE;
    9898}
     99
     100void FreeGraphic () {
     101  free (graphic->pixels);
     102  free (graphic->cmap);
     103  free (graphic->color);
     104  free (graphic->colormapName);
     105  free (graphic);
     106}
  • branches/eam_branches/ohana.20190329/src/kapa2/src/bDrawImage.c

    r40781 r40782  
    187187
    188188  free (data);
    189 
    190   // XDestroyImage (pix);
    191189}
    192190
  • branches/eam_branches/ohana.20190329/src/kapa2/src/kapa.c

    r40781 r40782  
    1010  EventLoop ();
    1111
    12   // free things related to the graphic:
    13   {
    14     Graphic *graphic = GetGraphic ();
    15     FreeVisual(graphic);
    16   }
    17  
    1812  CloseDisplay ();
     13
     14  // free things
     15  FreeLayout();
     16  FreeGraphic();
     17  FREE (NAME_WINDOW);
     18
    1919  MemoryDumpAndExit ();
    2020}
Note: See TracChangeset for help on using the changeset viewer.