diff options
| -rw-r--r-- | notify.c | 9 | ||||
| -rw-r--r-- | shm.c | 2 | ||||
| -rw-r--r-- | terminal.c | 4 |
3 files changed, 11 insertions, 4 deletions
@@ -505,10 +505,13 @@ notify_icon_del(struct terminal *term, const char *id) void notify_icon_free(struct notification_icon *icon) { - if (icon->tmp_file_fd >= 0) - close(icon->tmp_file_fd); - if (icon->tmp_file_name != NULL) + if (icon->tmp_file_name != NULL) { unlink(icon->tmp_file_name); + if (icon->tmp_file_fd >= 0) { + xassert(icon->tmp_file_fd > 0); // DEBUG + close(icon->tmp_file_fd); + } + } free(icon->id); free(icon->symbolic_name); @@ -255,7 +255,7 @@ instantiate_offset(struct buffer_private *buf, off_t new_offset) void *mmapped = MAP_FAILED; struct wl_buffer *wl_buf = NULL; - pixman_image_t **pix = xcalloc(buf->public.pix_instances, sizeof(*pix)); + pixman_image_t **pix = xcalloc(buf->public.pix_instances, sizeof(pix[0])); mmapped = (uint8_t *)pool->real_mmapped + new_offset; @@ -1330,6 +1330,10 @@ term_init(const struct config *conf, struct fdm *fdm, struct reaper *reaper, } } + for (size_t i = 0; i < ALEN(term->notification_icons); i++) { + term->notification_icons[i].tmp_file_fd = -1; + } + add_utmp_record(conf, reaper, ptmx); if (!pty_path) { |
