[Xfce4-commits] [apps/xfce4-screenshooter] 07/10: Clean up allocated memory
noreply at xfce.org
noreply at xfce.org
Mon Dec 17 00:04:41 CET 2018
This is an automated email from the git hooks/post-receive script.
a n d r e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository apps/xfce4-screenshooter.
commit 0f612fc576a88fd96997d839ee0a06dd40d0ce5f
Author: Andre Miranda <andreldm at xfce.org>
Date: Sun Dec 16 01:10:36 2018 -0300
Clean up allocated memory
---
lib/screenshooter-imgur-dialog.c | 22 +++++++++++++++++++++-
lib/screenshooter-job-callbacks.c | 2 ++
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/lib/screenshooter-imgur-dialog.c b/lib/screenshooter-imgur-dialog.c
index 75c3cae..c3bfc6b 100644
--- a/lib/screenshooter-imgur-dialog.c
+++ b/lib/screenshooter-imgur-dialog.c
@@ -69,7 +69,19 @@ void screenshooter_imgur_dialog_init (ScreenshooterImgurDialog *self)
+static void
+screenshooter_imgur_dialog_finalize (GObject *object)
{
+ ScreenshooterImgurDialog *self = SCREENSHOOTER_IMGUR_DIALOG (object);
+
+ g_free (self->image_url);
+ g_free (self->thumbnail_url);
+ g_free (self->small_thumbnail_url);
+ g_free (self->delete_link);
+
+ gtk_widget_destroy (self->window);
+
+ (*G_OBJECT_CLASS (screenshooter_imgur_dialog_parent_class)->finalize) (object);
}
@@ -77,8 +89,14 @@ void screenshooter_imgur_dialog_init (ScreenshooterImgurDialog *self)
static void
screenshooter_imgur_dialog_class_init (ScreenshooterImgurDialogClass *klass)
{
- g_return_if_fail (upload_name != NULL);
+ GObjectClass *gobject_class;
+ /* determine the parent type class */
+ screenshooter_imgur_dialog_parent_class = g_type_class_peek_parent (klass);
+
+ gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->finalize = screenshooter_imgur_dialog_finalize;
+}
@@ -163,6 +181,8 @@ screenshooter_imgur_dialog_new (const gchar *upload_name,
g_signal_connect (delete_link_copy_button, "clicked", G_CALLBACK (cb_delete_link_copy), self);
g_signal_connect (delete_link_view_button, "clicked", G_CALLBACK (cb_delete_link_view), self);
+ g_object_unref (builder);
+
return self;
}
diff --git a/lib/screenshooter-job-callbacks.c b/lib/screenshooter-job-callbacks.c
index c4220b7..7a15bb5 100644
--- a/lib/screenshooter-job-callbacks.c
+++ b/lib/screenshooter-job-callbacks.c
@@ -361,5 +361,7 @@ void cb_image_uploaded (ScreenshooterJob *job,
ScreenshooterImgurDialog* dialog = screenshooter_imgur_dialog_new (upload_name, delete_hash);
screenshooter_imgur_dialog_run (dialog);
+
+ g_object_unref (dialog);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list