[gedit/wip/printing-enhancements: 1/3] print-preview: fix memory leaks
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit/wip/printing-enhancements: 1/3] print-preview: fix memory leaks
- Date: Sun, 28 Jun 2015 06:34:07 +0000 (UTC)
commit e0a4824131f9ee56a688c83dbe469357b91e8202
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sun Jun 28 06:51:44 2015 +0200
print-preview: fix memory leaks
gedit/gedit-print-preview.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/gedit/gedit-print-preview.c b/gedit/gedit-print-preview.c
index dd4393c..fabd87c 100644
--- a/gedit/gedit-print-preview.c
+++ b/gedit/gedit-print-preview.c
@@ -81,6 +81,18 @@ struct _GeditPrintPreview
G_DEFINE_TYPE (GeditPrintPreview, gedit_print_preview, GTK_TYPE_GRID)
static void
+gedit_print_preview_dispose (GObject *object)
+{
+ GeditPrintPreview *preview = GEDIT_PRINT_PREVIEW (object);
+
+ g_clear_object (&preview->operation);
+ g_clear_object (&preview->context);
+ g_clear_object (&preview->gtk_preview);
+
+ G_OBJECT_CLASS (gedit_print_preview_parent_class)->dispose (object);
+}
+
+static void
gedit_print_preview_grab_focus (GtkWidget *widget)
{
GeditPrintPreview *preview = GEDIT_PRINT_PREVIEW (widget);
@@ -91,8 +103,11 @@ gedit_print_preview_grab_focus (GtkWidget *widget)
static void
gedit_print_preview_class_init (GeditPrintPreviewClass *klass)
{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ object_class->dispose = gedit_print_preview_dispose;
+
widget_class->grab_focus = gedit_print_preview_grab_focus;
/* Bind class to template */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]