diff options
| author | Gerd Moellmann | 2000-03-30 09:27:30 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-03-30 09:27:30 +0000 |
| commit | e3130015d6f811729b8d3c883c586ff74f0636ec (patch) | |
| tree | e5ae9f5dbc68e3940b5165180d6c40286a399acc /src | |
| parent | d2ff77dab1e5cb6393a57eb43f208c3377ecbf13 (diff) | |
| download | emacs-e3130015d6f811729b8d3c883c586ff74f0636ec.tar.gz emacs-e3130015d6f811729b8d3c883c586ff74f0636ec.zip | |
(free_image_cache): Free the cache structure itself
last, after all its members have been freed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/xfns.c b/src/xfns.c index fed93404f3f..d23d4f0f384 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -5383,8 +5383,8 @@ free_image_cache (f) | |||
| 5383 | for (i = 0; i < c->used; ++i) | 5383 | for (i = 0; i < c->used; ++i) |
| 5384 | free_image (f, c->images[i]); | 5384 | free_image (f, c->images[i]); |
| 5385 | xfree (c->images); | 5385 | xfree (c->images); |
| 5386 | xfree (c); | ||
| 5387 | xfree (c->buckets); | 5386 | xfree (c->buckets); |
| 5387 | xfree (c); | ||
| 5388 | FRAME_X_IMAGE_CACHE (f) = NULL; | 5388 | FRAME_X_IMAGE_CACHE (f) = NULL; |
| 5389 | } | 5389 | } |
| 5390 | } | 5390 | } |
| @@ -5841,7 +5841,7 @@ enum xbm_token | |||
| 5841 | Both the file and data forms may contain the additional entries | 5841 | Both the file and data forms may contain the additional entries |
| 5842 | `:background COLOR' and `:foreground COLOR'. If not present, | 5842 | `:background COLOR' and `:foreground COLOR'. If not present, |
| 5843 | foreground and background of the frame on which the image is | 5843 | foreground and background of the frame on which the image is |
| 5844 | displayed, is used. */ | 5844 | displayed is used. */ |
| 5845 | 5845 | ||
| 5846 | static int | 5846 | static int |
| 5847 | xbm_image_p (object) | 5847 | xbm_image_p (object) |
| @@ -6111,7 +6111,6 @@ xbm_read_bitmap_file_data (file, width, height, data) | |||
| 6111 | 6111 | ||
| 6112 | if (v10) | 6112 | if (v10) |
| 6113 | { | 6113 | { |
| 6114 | |||
| 6115 | for (i = 0; i < nbytes; i += 2) | 6114 | for (i = 0; i < nbytes; i += 2) |
| 6116 | { | 6115 | { |
| 6117 | int val = value; | 6116 | int val = value; |
| @@ -7957,6 +7956,7 @@ struct my_jpeg_error_mgr | |||
| 7957 | jmp_buf setjmp_buffer; | 7956 | jmp_buf setjmp_buffer; |
| 7958 | }; | 7957 | }; |
| 7959 | 7958 | ||
| 7959 | |||
| 7960 | static void | 7960 | static void |
| 7961 | my_error_exit (cinfo) | 7961 | my_error_exit (cinfo) |
| 7962 | j_common_ptr cinfo; | 7962 | j_common_ptr cinfo; |
| @@ -7965,6 +7965,7 @@ my_error_exit (cinfo) | |||
| 7965 | longjmp (mgr->setjmp_buffer, 1); | 7965 | longjmp (mgr->setjmp_buffer, 1); |
| 7966 | } | 7966 | } |
| 7967 | 7967 | ||
| 7968 | |||
| 7968 | /* Init source method for JPEG data source manager. Called by | 7969 | /* Init source method for JPEG data source manager. Called by |
| 7969 | jpeg_read_header() before any data is actually read. See | 7970 | jpeg_read_header() before any data is actually read. See |
| 7970 | libjpeg.doc from the JPEG lib distribution. */ | 7971 | libjpeg.doc from the JPEG lib distribution. */ |
| @@ -8329,6 +8330,7 @@ typedef struct | |||
| 8329 | } | 8330 | } |
| 8330 | tiff_memory_source; | 8331 | tiff_memory_source; |
| 8331 | 8332 | ||
| 8333 | |||
| 8332 | static size_t | 8334 | static size_t |
| 8333 | tiff_read_from_memory (data, buf, size) | 8335 | tiff_read_from_memory (data, buf, size) |
| 8334 | thandle_t data; | 8336 | thandle_t data; |
| @@ -8344,6 +8346,7 @@ tiff_read_from_memory (data, buf, size) | |||
| 8344 | return size; | 8346 | return size; |
| 8345 | } | 8347 | } |
| 8346 | 8348 | ||
| 8349 | |||
| 8347 | static size_t | 8350 | static size_t |
| 8348 | tiff_write_from_memory (data, buf, size) | 8351 | tiff_write_from_memory (data, buf, size) |
| 8349 | thandle_t data; | 8352 | thandle_t data; |
| @@ -8353,6 +8356,7 @@ tiff_write_from_memory (data, buf, size) | |||
| 8353 | return (size_t) -1; | 8356 | return (size_t) -1; |
| 8354 | } | 8357 | } |
| 8355 | 8358 | ||
| 8359 | |||
| 8356 | static toff_t | 8360 | static toff_t |
| 8357 | tiff_seek_in_memory (data, off, whence) | 8361 | tiff_seek_in_memory (data, off, whence) |
| 8358 | thandle_t data; | 8362 | thandle_t data; |
| @@ -8387,6 +8391,7 @@ tiff_seek_in_memory (data, off, whence) | |||
| 8387 | return src->index; | 8391 | return src->index; |
| 8388 | } | 8392 | } |
| 8389 | 8393 | ||
| 8394 | |||
| 8390 | static int | 8395 | static int |
| 8391 | tiff_close_memory (data) | 8396 | tiff_close_memory (data) |
| 8392 | thandle_t data; | 8397 | thandle_t data; |
| @@ -8395,6 +8400,7 @@ tiff_close_memory (data) | |||
| 8395 | return 0; | 8400 | return 0; |
| 8396 | } | 8401 | } |
| 8397 | 8402 | ||
| 8403 | |||
| 8398 | static int | 8404 | static int |
| 8399 | tiff_mmap_memory (data, pbase, psize) | 8405 | tiff_mmap_memory (data, pbase, psize) |
| 8400 | thandle_t data; | 8406 | thandle_t data; |
| @@ -8405,6 +8411,7 @@ tiff_mmap_memory (data, pbase, psize) | |||
| 8405 | return 0; | 8411 | return 0; |
| 8406 | } | 8412 | } |
| 8407 | 8413 | ||
| 8414 | |||
| 8408 | static void | 8415 | static void |
| 8409 | tiff_unmap_memory (data, base, size) | 8416 | tiff_unmap_memory (data, base, size) |
| 8410 | thandle_t data; | 8417 | thandle_t data; |
| @@ -8414,6 +8421,7 @@ tiff_unmap_memory (data, base, size) | |||
| 8414 | /* We don't need to do this. */ | 8421 | /* We don't need to do this. */ |
| 8415 | } | 8422 | } |
| 8416 | 8423 | ||
| 8424 | |||
| 8417 | static toff_t | 8425 | static toff_t |
| 8418 | tiff_size_of_memory (data) | 8426 | tiff_size_of_memory (data) |
| 8419 | thandle_t data; | 8427 | thandle_t data; |
| @@ -8421,6 +8429,7 @@ tiff_size_of_memory (data) | |||
| 8421 | return ((tiff_memory_source *) data)->len; | 8429 | return ((tiff_memory_source *) data)->len; |
| 8422 | } | 8430 | } |
| 8423 | 8431 | ||
| 8432 | |||
| 8424 | /* Load TIFF image IMG for use on frame F. Value is non-zero if | 8433 | /* Load TIFF image IMG for use on frame F. Value is non-zero if |
| 8425 | successful. */ | 8434 | successful. */ |
| 8426 | 8435 | ||
| @@ -8612,6 +8621,7 @@ static struct image_type gif_type = | |||
| 8612 | NULL | 8621 | NULL |
| 8613 | }; | 8622 | }; |
| 8614 | 8623 | ||
| 8624 | |||
| 8615 | /* Return non-zero if OBJECT is a valid GIF image specification. */ | 8625 | /* Return non-zero if OBJECT is a valid GIF image specification. */ |
| 8616 | 8626 | ||
| 8617 | static int | 8627 | static int |
| @@ -8630,6 +8640,7 @@ gif_image_p (object) | |||
| 8630 | return fmt[GIF_FILE].count + fmt[GIF_DATA].count == 1; | 8640 | return fmt[GIF_FILE].count + fmt[GIF_DATA].count == 1; |
| 8631 | } | 8641 | } |
| 8632 | 8642 | ||
| 8643 | |||
| 8633 | /* Reading a GIF image from memory | 8644 | /* Reading a GIF image from memory |
| 8634 | Based on the PNG memory stuff to a certain extent. */ | 8645 | Based on the PNG memory stuff to a certain extent. */ |
| 8635 | 8646 | ||
| @@ -8641,6 +8652,7 @@ typedef struct | |||
| 8641 | } | 8652 | } |
| 8642 | gif_memory_source; | 8653 | gif_memory_source; |
| 8643 | 8654 | ||
| 8655 | |||
| 8644 | /* Make the current memory source available to gif_read_from_memory. | 8656 | /* Make the current memory source available to gif_read_from_memory. |
| 8645 | It's done this way because not all versions of libungif support | 8657 | It's done this way because not all versions of libungif support |
| 8646 | a UserData field in the GifFileType structure. */ | 8658 | a UserData field in the GifFileType structure. */ |
| @@ -9747,7 +9759,7 @@ TIMEOUT nil means use the default timeout of 5 seconds.") | |||
| 9747 | /* Let the row go over the full width of the frame. */ | 9759 | /* Let the row go over the full width of the frame. */ |
| 9748 | row->full_width_p = 1; | 9760 | row->full_width_p = 1; |
| 9749 | 9761 | ||
| 9750 | /* There's a glyph at the end of rows that is use to place | 9762 | /* There's a glyph at the end of rows that is used to place |
| 9751 | the cursor there. Don't include the width of this glyph. */ | 9763 | the cursor there. Don't include the width of this glyph. */ |
| 9752 | if (row->used[TEXT_AREA]) | 9764 | if (row->used[TEXT_AREA]) |
| 9753 | { | 9765 | { |