summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>1999-05-07 14:29:04 +0000
committerOwen Taylor <otaylor@src.gnome.org>1999-05-07 14:29:04 +0000
commit5e52b31fd7d23b2b8e327e2fcfb47a3c87b7740c (patch)
tree5d5be6557f5ebb66bff604b011775a60d30b51c3
parentbbe8b7ba614823c808db13f95a18e1c7b4b573a2 (diff)
downloadgdk-pixbuf-5e52b31fd7d23b2b8e327e2fcfb47a3c87b7740c.tar.gz
Unset the user data on the window before destroying it.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset the user data on the window before destroying it. * gtk/gtknotebook.c (gtk_notebook_unrealize): Add an unrealize handler to take care of destroying notebook->panel properly. (Bug #1198 - Morten Welinder <terra@diku.dk>) * gtk/gtktext.c (expand_scratch_buffer): Fix reversal of g_new and g_realloc to stop memory leak. (Actually, we could just use g_realloc(), but I'm not 100% sure that is portable). (Bug #1196 - Morten Welinder <terra@diku.dk>)
-rw-r--r--ChangeLog16
-rw-r--r--ChangeLog.pre-2-016
-rw-r--r--ChangeLog.pre-2-1016
-rw-r--r--ChangeLog.pre-2-216
-rw-r--r--ChangeLog.pre-2-416
-rw-r--r--ChangeLog.pre-2-616
-rw-r--r--ChangeLog.pre-2-816
-rw-r--r--gtk/gtknotebook.c26
-rw-r--r--gtk/gtktext.c6
9 files changed, 141 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 805d1a51f..4b94d678f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
+ the user data on the window before destroying it.
+
+ * gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
+ unrealize handler to take care of destroying
+ notebook->panel properly.
+ (Bug #1198 - Morten Welinder <terra@diku.dk>)
+
+ * gtk/gtktext.c (expand_scratch_buffer): Fix reversal
+ of g_new and g_realloc to stop memory leak. (Actually,
+ we could just use g_realloc(), but I'm not 100% sure
+ that is portable).
+ (Bug #1196 - Morten Welinder <terra@diku.dk>)
+
Wed May 5 22:51:06 1999 Owen Taylor <otaylor@redhat.com>
Patch from Sung-Hyun Nam <namsh@lgic.co.kr>
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index 805d1a51f..4b94d678f 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,19 @@
+Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
+ the user data on the window before destroying it.
+
+ * gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
+ unrealize handler to take care of destroying
+ notebook->panel properly.
+ (Bug #1198 - Morten Welinder <terra@diku.dk>)
+
+ * gtk/gtktext.c (expand_scratch_buffer): Fix reversal
+ of g_new and g_realloc to stop memory leak. (Actually,
+ we could just use g_realloc(), but I'm not 100% sure
+ that is portable).
+ (Bug #1196 - Morten Welinder <terra@diku.dk>)
+
Wed May 5 22:51:06 1999 Owen Taylor <otaylor@redhat.com>
Patch from Sung-Hyun Nam <namsh@lgic.co.kr>
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 805d1a51f..4b94d678f 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,19 @@
+Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
+ the user data on the window before destroying it.
+
+ * gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
+ unrealize handler to take care of destroying
+ notebook->panel properly.
+ (Bug #1198 - Morten Welinder <terra@diku.dk>)
+
+ * gtk/gtktext.c (expand_scratch_buffer): Fix reversal
+ of g_new and g_realloc to stop memory leak. (Actually,
+ we could just use g_realloc(), but I'm not 100% sure
+ that is portable).
+ (Bug #1196 - Morten Welinder <terra@diku.dk>)
+
Wed May 5 22:51:06 1999 Owen Taylor <otaylor@redhat.com>
Patch from Sung-Hyun Nam <namsh@lgic.co.kr>
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index 805d1a51f..4b94d678f 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,19 @@
+Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
+ the user data on the window before destroying it.
+
+ * gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
+ unrealize handler to take care of destroying
+ notebook->panel properly.
+ (Bug #1198 - Morten Welinder <terra@diku.dk>)
+
+ * gtk/gtktext.c (expand_scratch_buffer): Fix reversal
+ of g_new and g_realloc to stop memory leak. (Actually,
+ we could just use g_realloc(), but I'm not 100% sure
+ that is portable).
+ (Bug #1196 - Morten Welinder <terra@diku.dk>)
+
Wed May 5 22:51:06 1999 Owen Taylor <otaylor@redhat.com>
Patch from Sung-Hyun Nam <namsh@lgic.co.kr>
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index 805d1a51f..4b94d678f 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,19 @@
+Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
+ the user data on the window before destroying it.
+
+ * gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
+ unrealize handler to take care of destroying
+ notebook->panel properly.
+ (Bug #1198 - Morten Welinder <terra@diku.dk>)
+
+ * gtk/gtktext.c (expand_scratch_buffer): Fix reversal
+ of g_new and g_realloc to stop memory leak. (Actually,
+ we could just use g_realloc(), but I'm not 100% sure
+ that is portable).
+ (Bug #1196 - Morten Welinder <terra@diku.dk>)
+
Wed May 5 22:51:06 1999 Owen Taylor <otaylor@redhat.com>
Patch from Sung-Hyun Nam <namsh@lgic.co.kr>
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index 805d1a51f..4b94d678f 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,19 @@
+Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
+ the user data on the window before destroying it.
+
+ * gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
+ unrealize handler to take care of destroying
+ notebook->panel properly.
+ (Bug #1198 - Morten Welinder <terra@diku.dk>)
+
+ * gtk/gtktext.c (expand_scratch_buffer): Fix reversal
+ of g_new and g_realloc to stop memory leak. (Actually,
+ we could just use g_realloc(), but I'm not 100% sure
+ that is portable).
+ (Bug #1196 - Morten Welinder <terra@diku.dk>)
+
Wed May 5 22:51:06 1999 Owen Taylor <otaylor@redhat.com>
Patch from Sung-Hyun Nam <namsh@lgic.co.kr>
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 805d1a51f..4b94d678f 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,19 @@
+Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
+ the user data on the window before destroying it.
+
+ * gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
+ unrealize handler to take care of destroying
+ notebook->panel properly.
+ (Bug #1198 - Morten Welinder <terra@diku.dk>)
+
+ * gtk/gtktext.c (expand_scratch_buffer): Fix reversal
+ of g_new and g_realloc to stop memory leak. (Actually,
+ we could just use g_realloc(), but I'm not 100% sure
+ that is portable).
+ (Bug #1196 - Morten Welinder <terra@diku.dk>)
+
Wed May 5 22:51:06 1999 Owen Taylor <otaylor@redhat.com>
Patch from Sung-Hyun Nam <namsh@lgic.co.kr>
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index b8ef75433..9c25f3bfd 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -94,6 +94,7 @@ static void gtk_notebook_get_arg (GtkObject *object,
static void gtk_notebook_map (GtkWidget *widget);
static void gtk_notebook_unmap (GtkWidget *widget);
static void gtk_notebook_realize (GtkWidget *widget);
+static void gtk_notebook_unrealize (GtkWidget *widget);
static void gtk_notebook_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void gtk_notebook_size_allocate (GtkWidget *widget,
@@ -284,6 +285,7 @@ gtk_notebook_class_init (GtkNotebookClass *class)
widget_class->map = gtk_notebook_map;
widget_class->unmap = gtk_notebook_unmap;
widget_class->realize = gtk_notebook_realize;
+ widget_class->unrealize = gtk_notebook_unrealize;
widget_class->size_request = gtk_notebook_size_request;
widget_class->size_allocate = gtk_notebook_size_allocate;
widget_class->draw = gtk_notebook_draw;
@@ -565,6 +567,29 @@ gtk_notebook_realize (GtkWidget *widget)
}
static void
+gtk_notebook_unrealize (GtkWidget *widget)
+{
+ GtkNotebook *notebook;
+ GdkWindowAttr attributes;
+ gint attributes_mask;
+
+ g_return_if_fail (widget != NULL);
+ g_return_if_fail (GTK_IS_NOTEBOOK (widget));
+
+ notebook = GTK_NOTEBOOK (widget);
+
+ if (notebook->panel)
+ {
+ gdk_window_set_user_data (notebook->panel, NULL);
+ gdk_window_destroy (notebook->panel);
+ notebook->panel = NULL;
+ }
+
+ if (GTK_WIDGET_CLASS (parent_class)->unrealize)
+ (* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
+}
+
+static void
gtk_notebook_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
@@ -3969,6 +3994,7 @@ gtk_notebook_set_scrollable (GtkNotebook *notebook,
}
else if (notebook->panel)
{
+ gdk_window_set_user_data (notebook->panel, NULL);
gdk_window_destroy (notebook->panel);
notebook->panel = NULL;
}
diff --git a/gtk/gtktext.c b/gtk/gtktext.c
index 7d8daf230..2a716f5ea 100644
--- a/gtk/gtktext.c
+++ b/gtk/gtktext.c
@@ -4827,15 +4827,15 @@ expand_scratch_buffer (GtkText* text, guint len)
if (text->use_wchar)
{
- if (text->scratch_buffer.wc)
+ if (!text->scratch_buffer.wc)
text->scratch_buffer.wc = g_new (GdkWChar, i);
else
text->scratch_buffer.wc = g_realloc (text->scratch_buffer.wc,
- i*sizeof (GdkWChar));
+ i * sizeof (GdkWChar));
}
else
{
- if (text->scratch_buffer.ch)
+ if (!text->scratch_buffer.ch)
text->scratch_buffer.ch = g_new (guchar, i);
else
text->scratch_buffer.ch = g_realloc (text->scratch_buffer.ch, i);