aboutsummaryrefslogtreecommitdiff
path: root/fastiv-browser.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-11-23 17:12:31 +0100
committerPřemysl Eric Janouch <p@janouch.name>2021-11-23 17:13:21 +0100
commitfee901a5901d4bbacbf3ce90bcc3321a5c5e721e (patch)
tree6294de3e9050dc3435aaefc4cb1e22903f0c0558 /fastiv-browser.c
parent7ab1a6d2465dabc37e3e5f751de6e07011ee4b72 (diff)
downloadfiv-fee901a5901d4bbacbf3ce90bcc3321a5c5e721e.tar.gz
fiv-fee901a5901d4bbacbf3ce90bcc3321a5c5e721e.tar.xz
fiv-fee901a5901d4bbacbf3ce90bcc3321a5c5e721e.zip
Improve memory management
Diffstat (limited to 'fastiv-browser.c')
-rw-r--r--fastiv-browser.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fastiv-browser.c b/fastiv-browser.c
index f130473..0ed8c50 100644
--- a/fastiv-browser.c
+++ b/fastiv-browser.c
@@ -73,8 +73,7 @@ static void
entry_free(Entry *self)
{
g_free(self->filename);
- if (self->thumbnail)
- cairo_surface_destroy(self->thumbnail);
+ g_clear_pointer(&self->thumbnail, cairo_surface_destroy);
g_clear_object(&self->icon);
}
@@ -349,8 +348,7 @@ entry_add_thumbnail(gpointer data, gpointer user_data)
{
Entry *self = data;
g_clear_object(&self->icon);
- if (self->thumbnail)
- cairo_surface_destroy(self->thumbnail);
+ g_clear_pointer(&self->thumbnail, cairo_surface_destroy);
FastivBrowser *browser = FASTIV_BROWSER(user_data);
self->thumbnail = rescale_thumbnail(