Changeset 3082 for libpipi/trunk


Ignore:
Timestamp:
Oct 24, 2008, 1:49:56 PM (12 years ago)
Author:
Jean-Yves Lamoureux
Message:
  • Fixed a memory leak in histogram example
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpipi/trunk/examples/histogram.c

    r2902 r3082  
    1111    char *srcname = NULL, *dstname = NULL;
    1212    pipi_image_t *img, *newimg, *tmp;
    13     pipi_histogram_t* histogram;
     13    pipi_histogram_t* histogram = NULL;
    1414    int ret = 0;
    1515    if(argc < 2)
     
    3838    pipi_get_image_histogram(tmp, histogram, PIPI_COLOR_R|PIPI_COLOR_G|PIPI_COLOR_B);
    3939
     40    pipi_render_histogram(tmp, histogram, PIPI_COLOR_R|PIPI_COLOR_G|PIPI_COLOR_B);
    4041
    41     pipi_render_histogram(tmp, histogram, PIPI_COLOR_R|PIPI_COLOR_G|PIPI_COLOR_B);
     42    pipi_free_histogram(histogram);
    4243
    4344    pipi_save(tmp, dstname);
    4445    pipi_free(newimg);
    45 
     46    pipi_free(tmp);
    4647    return ret;
    4748}
Note: See TracChangeset for help on using the changeset viewer.