mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-12 13:30:19 +00:00
changed g_new()s to malloc()s and g_free()s to free()s to avoid mixing
Mon Sep 14 21:47:35 CDT 1998 Shawn T. Amundson <amundson@gtk.org> * gdk/gdkimage.c: changed g_new()s to malloc()s and g_free()s to free()s to avoid mixing g_new()s with free()s. X itself uses free() on some of the malloced memory.
This commit is contained in:
parent
fb00a59c2f
commit
c2f99dd168
@ -1,3 +1,10 @@
|
|||||||
|
Mon Sep 14 21:47:35 CDT 1998 Shawn T. Amundson <amundson@gtk.org>
|
||||||
|
|
||||||
|
* gdk/gdkimage.c: changed g_new()s to malloc()s and
|
||||||
|
g_free()s to free()s to avoid mixing g_new()s with
|
||||||
|
free()s. X itself uses free() on some of the
|
||||||
|
malloced memory.
|
||||||
|
|
||||||
Sat Sep 12 10:44:06 1998 Owen Taylor <otaylor@redhat.com>
|
Sat Sep 12 10:44:06 1998 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtkfilesel.c: Maintain a list of directories like
|
* gtkfilesel.c: Maintain a list of directories like
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
Mon Sep 14 21:47:35 CDT 1998 Shawn T. Amundson <amundson@gtk.org>
|
||||||
|
|
||||||
|
* gdk/gdkimage.c: changed g_new()s to malloc()s and
|
||||||
|
g_free()s to free()s to avoid mixing g_new()s with
|
||||||
|
free()s. X itself uses free() on some of the
|
||||||
|
malloced memory.
|
||||||
|
|
||||||
Sat Sep 12 10:44:06 1998 Owen Taylor <otaylor@redhat.com>
|
Sat Sep 12 10:44:06 1998 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtkfilesel.c: Maintain a list of directories like
|
* gtkfilesel.c: Maintain a list of directories like
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
Mon Sep 14 21:47:35 CDT 1998 Shawn T. Amundson <amundson@gtk.org>
|
||||||
|
|
||||||
|
* gdk/gdkimage.c: changed g_new()s to malloc()s and
|
||||||
|
g_free()s to free()s to avoid mixing g_new()s with
|
||||||
|
free()s. X itself uses free() on some of the
|
||||||
|
malloced memory.
|
||||||
|
|
||||||
Sat Sep 12 10:44:06 1998 Owen Taylor <otaylor@redhat.com>
|
Sat Sep 12 10:44:06 1998 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtkfilesel.c: Maintain a list of directories like
|
* gtkfilesel.c: Maintain a list of directories like
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
Mon Sep 14 21:47:35 CDT 1998 Shawn T. Amundson <amundson@gtk.org>
|
||||||
|
|
||||||
|
* gdk/gdkimage.c: changed g_new()s to malloc()s and
|
||||||
|
g_free()s to free()s to avoid mixing g_new()s with
|
||||||
|
free()s. X itself uses free() on some of the
|
||||||
|
malloced memory.
|
||||||
|
|
||||||
Sat Sep 12 10:44:06 1998 Owen Taylor <otaylor@redhat.com>
|
Sat Sep 12 10:44:06 1998 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtkfilesel.c: Maintain a list of directories like
|
* gtkfilesel.c: Maintain a list of directories like
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
Mon Sep 14 21:47:35 CDT 1998 Shawn T. Amundson <amundson@gtk.org>
|
||||||
|
|
||||||
|
* gdk/gdkimage.c: changed g_new()s to malloc()s and
|
||||||
|
g_free()s to free()s to avoid mixing g_new()s with
|
||||||
|
free()s. X itself uses free() on some of the
|
||||||
|
malloced memory.
|
||||||
|
|
||||||
Sat Sep 12 10:44:06 1998 Owen Taylor <otaylor@redhat.com>
|
Sat Sep 12 10:44:06 1998 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtkfilesel.c: Maintain a list of directories like
|
* gtkfilesel.c: Maintain a list of directories like
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
Mon Sep 14 21:47:35 CDT 1998 Shawn T. Amundson <amundson@gtk.org>
|
||||||
|
|
||||||
|
* gdk/gdkimage.c: changed g_new()s to malloc()s and
|
||||||
|
g_free()s to free()s to avoid mixing g_new()s with
|
||||||
|
free()s. X itself uses free() on some of the
|
||||||
|
malloced memory.
|
||||||
|
|
||||||
Sat Sep 12 10:44:06 1998 Owen Taylor <otaylor@redhat.com>
|
Sat Sep 12 10:44:06 1998 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtkfilesel.c: Maintain a list of directories like
|
* gtkfilesel.c: Maintain a list of directories like
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
Mon Sep 14 21:47:35 CDT 1998 Shawn T. Amundson <amundson@gtk.org>
|
||||||
|
|
||||||
|
* gdk/gdkimage.c: changed g_new()s to malloc()s and
|
||||||
|
g_free()s to free()s to avoid mixing g_new()s with
|
||||||
|
free()s. X itself uses free() on some of the
|
||||||
|
malloced memory.
|
||||||
|
|
||||||
Sat Sep 12 10:44:06 1998 Owen Taylor <otaylor@redhat.com>
|
Sat Sep 12 10:44:06 1998 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtkfilesel.c: Maintain a list of directories like
|
* gtkfilesel.c: Maintain a list of directories like
|
||||||
|
@ -84,7 +84,7 @@ gdk_image_new_bitmap(GdkVisual *visual, gpointer data, gint w, gint h)
|
|||||||
Visual *xvisual;
|
Visual *xvisual;
|
||||||
GdkImage *image;
|
GdkImage *image;
|
||||||
GdkImagePrivate *private;
|
GdkImagePrivate *private;
|
||||||
private = g_new(GdkImagePrivate, 1);
|
private = malloc (sizeof (GdkImagePrivate));
|
||||||
image = (GdkImage *) private;
|
image = (GdkImage *) private;
|
||||||
private->xdisplay = gdk_display;
|
private->xdisplay = gdk_display;
|
||||||
private->image_put = gdk_image_put_normal;
|
private->image_put = gdk_image_put_normal;
|
||||||
@ -165,7 +165,7 @@ gdk_image_new (GdkImageType type,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
private = g_new (GdkImagePrivate, 1);
|
private = malloc (sizeof (GdkImagePrivate));
|
||||||
image = (GdkImage*) private;
|
image = (GdkImage*) private;
|
||||||
|
|
||||||
private->xdisplay = gdk_display;
|
private->xdisplay = gdk_display;
|
||||||
@ -187,7 +187,7 @@ gdk_image_new (GdkImageType type,
|
|||||||
{
|
{
|
||||||
private->image_put = gdk_image_put_shared;
|
private->image_put = gdk_image_put_shared;
|
||||||
|
|
||||||
private->x_shm_info = g_new (XShmSegmentInfo, 1);
|
private->x_shm_info = malloc (sizeof (XShmSegmentInfo));
|
||||||
x_shm_info = private->x_shm_info;
|
x_shm_info = private->x_shm_info;
|
||||||
|
|
||||||
private->ximage = XShmCreateImage (private->xdisplay, xvisual, visual->depth,
|
private->ximage = XShmCreateImage (private->xdisplay, xvisual, visual->depth,
|
||||||
@ -196,7 +196,7 @@ gdk_image_new (GdkImageType type,
|
|||||||
{
|
{
|
||||||
g_warning ("XShmCreateImage failed");
|
g_warning ("XShmCreateImage failed");
|
||||||
|
|
||||||
g_free (image);
|
free (image);
|
||||||
gdk_use_xshm = False;
|
gdk_use_xshm = False;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -210,8 +210,8 @@ gdk_image_new (GdkImageType type,
|
|||||||
g_warning ("shmget failed!");
|
g_warning ("shmget failed!");
|
||||||
|
|
||||||
XDestroyImage (private->ximage);
|
XDestroyImage (private->ximage);
|
||||||
g_free (private->x_shm_info);
|
free (private->x_shm_info);
|
||||||
g_free (image);
|
free (image);
|
||||||
|
|
||||||
gdk_use_xshm = False;
|
gdk_use_xshm = False;
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -228,8 +228,8 @@ gdk_image_new (GdkImageType type,
|
|||||||
XDestroyImage (private->ximage);
|
XDestroyImage (private->ximage);
|
||||||
shmctl (x_shm_info->shmid, IPC_RMID, 0);
|
shmctl (x_shm_info->shmid, IPC_RMID, 0);
|
||||||
|
|
||||||
g_free (private->x_shm_info);
|
free (private->x_shm_info);
|
||||||
g_free (image);
|
free (image);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -253,8 +253,8 @@ gdk_image_new (GdkImageType type,
|
|||||||
shmdt (x_shm_info->shmaddr);
|
shmdt (x_shm_info->shmaddr);
|
||||||
shmctl (x_shm_info->shmid, IPC_RMID, 0);
|
shmctl (x_shm_info->shmid, IPC_RMID, 0);
|
||||||
|
|
||||||
g_free (private->x_shm_info);
|
free (private->x_shm_info);
|
||||||
g_free (image);
|
free (image);
|
||||||
|
|
||||||
gdk_use_xshm = False;
|
gdk_use_xshm = False;
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -265,12 +265,12 @@ gdk_image_new (GdkImageType type,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_free (image);
|
free (image);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#else /* USE_SHM */
|
#else /* USE_SHM */
|
||||||
g_free (image);
|
free (image);
|
||||||
return NULL;
|
return NULL;
|
||||||
#endif /* USE_SHM */
|
#endif /* USE_SHM */
|
||||||
case GDK_IMAGE_NORMAL:
|
case GDK_IMAGE_NORMAL:
|
||||||
@ -279,8 +279,7 @@ gdk_image_new (GdkImageType type,
|
|||||||
private->ximage = XCreateImage (private->xdisplay, xvisual, visual->depth,
|
private->ximage = XCreateImage (private->xdisplay, xvisual, visual->depth,
|
||||||
ZPixmap, 0, 0, width, height, 32, 0);
|
ZPixmap, 0, 0, width, height, 32, 0);
|
||||||
|
|
||||||
private->ximage->data = g_new (char, private->ximage->bytes_per_line *
|
private->ximage->data = malloc (sizeof (char) * private->ximage->bytes_per_line * private->ximage->height);
|
||||||
private->ximage->height);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GDK_IMAGE_FASTEST:
|
case GDK_IMAGE_FASTEST:
|
||||||
@ -331,7 +330,7 @@ gdk_image_get (GdkWindow *window,
|
|||||||
if (win_private->destroyed)
|
if (win_private->destroyed)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
private = g_new (GdkImagePrivate, 1);
|
private = malloc (sizeof (GdkImagePrivate));
|
||||||
image = (GdkImage*) private;
|
image = (GdkImage*) private;
|
||||||
|
|
||||||
private->xdisplay = gdk_display;
|
private->xdisplay = gdk_display;
|
||||||
@ -412,7 +411,7 @@ gdk_image_destroy (GdkImage *image)
|
|||||||
shmdt (x_shm_info->shmaddr);
|
shmdt (x_shm_info->shmaddr);
|
||||||
shmctl (x_shm_info->shmid, IPC_RMID, 0);
|
shmctl (x_shm_info->shmid, IPC_RMID, 0);
|
||||||
|
|
||||||
g_free (private->x_shm_info);
|
free (private->x_shm_info);
|
||||||
|
|
||||||
image_list = g_list_remove (image_list, image);
|
image_list = g_list_remove (image_list, image);
|
||||||
#else /* USE_SHM */
|
#else /* USE_SHM */
|
||||||
@ -424,7 +423,7 @@ gdk_image_destroy (GdkImage *image)
|
|||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free (image);
|
free (image);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -84,7 +84,7 @@ gdk_image_new_bitmap(GdkVisual *visual, gpointer data, gint w, gint h)
|
|||||||
Visual *xvisual;
|
Visual *xvisual;
|
||||||
GdkImage *image;
|
GdkImage *image;
|
||||||
GdkImagePrivate *private;
|
GdkImagePrivate *private;
|
||||||
private = g_new(GdkImagePrivate, 1);
|
private = malloc (sizeof (GdkImagePrivate));
|
||||||
image = (GdkImage *) private;
|
image = (GdkImage *) private;
|
||||||
private->xdisplay = gdk_display;
|
private->xdisplay = gdk_display;
|
||||||
private->image_put = gdk_image_put_normal;
|
private->image_put = gdk_image_put_normal;
|
||||||
@ -165,7 +165,7 @@ gdk_image_new (GdkImageType type,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
private = g_new (GdkImagePrivate, 1);
|
private = malloc (sizeof (GdkImagePrivate));
|
||||||
image = (GdkImage*) private;
|
image = (GdkImage*) private;
|
||||||
|
|
||||||
private->xdisplay = gdk_display;
|
private->xdisplay = gdk_display;
|
||||||
@ -187,7 +187,7 @@ gdk_image_new (GdkImageType type,
|
|||||||
{
|
{
|
||||||
private->image_put = gdk_image_put_shared;
|
private->image_put = gdk_image_put_shared;
|
||||||
|
|
||||||
private->x_shm_info = g_new (XShmSegmentInfo, 1);
|
private->x_shm_info = malloc (sizeof (XShmSegmentInfo));
|
||||||
x_shm_info = private->x_shm_info;
|
x_shm_info = private->x_shm_info;
|
||||||
|
|
||||||
private->ximage = XShmCreateImage (private->xdisplay, xvisual, visual->depth,
|
private->ximage = XShmCreateImage (private->xdisplay, xvisual, visual->depth,
|
||||||
@ -196,7 +196,7 @@ gdk_image_new (GdkImageType type,
|
|||||||
{
|
{
|
||||||
g_warning ("XShmCreateImage failed");
|
g_warning ("XShmCreateImage failed");
|
||||||
|
|
||||||
g_free (image);
|
free (image);
|
||||||
gdk_use_xshm = False;
|
gdk_use_xshm = False;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -210,8 +210,8 @@ gdk_image_new (GdkImageType type,
|
|||||||
g_warning ("shmget failed!");
|
g_warning ("shmget failed!");
|
||||||
|
|
||||||
XDestroyImage (private->ximage);
|
XDestroyImage (private->ximage);
|
||||||
g_free (private->x_shm_info);
|
free (private->x_shm_info);
|
||||||
g_free (image);
|
free (image);
|
||||||
|
|
||||||
gdk_use_xshm = False;
|
gdk_use_xshm = False;
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -228,8 +228,8 @@ gdk_image_new (GdkImageType type,
|
|||||||
XDestroyImage (private->ximage);
|
XDestroyImage (private->ximage);
|
||||||
shmctl (x_shm_info->shmid, IPC_RMID, 0);
|
shmctl (x_shm_info->shmid, IPC_RMID, 0);
|
||||||
|
|
||||||
g_free (private->x_shm_info);
|
free (private->x_shm_info);
|
||||||
g_free (image);
|
free (image);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -253,8 +253,8 @@ gdk_image_new (GdkImageType type,
|
|||||||
shmdt (x_shm_info->shmaddr);
|
shmdt (x_shm_info->shmaddr);
|
||||||
shmctl (x_shm_info->shmid, IPC_RMID, 0);
|
shmctl (x_shm_info->shmid, IPC_RMID, 0);
|
||||||
|
|
||||||
g_free (private->x_shm_info);
|
free (private->x_shm_info);
|
||||||
g_free (image);
|
free (image);
|
||||||
|
|
||||||
gdk_use_xshm = False;
|
gdk_use_xshm = False;
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -265,12 +265,12 @@ gdk_image_new (GdkImageType type,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_free (image);
|
free (image);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#else /* USE_SHM */
|
#else /* USE_SHM */
|
||||||
g_free (image);
|
free (image);
|
||||||
return NULL;
|
return NULL;
|
||||||
#endif /* USE_SHM */
|
#endif /* USE_SHM */
|
||||||
case GDK_IMAGE_NORMAL:
|
case GDK_IMAGE_NORMAL:
|
||||||
@ -279,8 +279,7 @@ gdk_image_new (GdkImageType type,
|
|||||||
private->ximage = XCreateImage (private->xdisplay, xvisual, visual->depth,
|
private->ximage = XCreateImage (private->xdisplay, xvisual, visual->depth,
|
||||||
ZPixmap, 0, 0, width, height, 32, 0);
|
ZPixmap, 0, 0, width, height, 32, 0);
|
||||||
|
|
||||||
private->ximage->data = g_new (char, private->ximage->bytes_per_line *
|
private->ximage->data = malloc (sizeof (char) * private->ximage->bytes_per_line * private->ximage->height);
|
||||||
private->ximage->height);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GDK_IMAGE_FASTEST:
|
case GDK_IMAGE_FASTEST:
|
||||||
@ -331,7 +330,7 @@ gdk_image_get (GdkWindow *window,
|
|||||||
if (win_private->destroyed)
|
if (win_private->destroyed)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
private = g_new (GdkImagePrivate, 1);
|
private = malloc (sizeof (GdkImagePrivate));
|
||||||
image = (GdkImage*) private;
|
image = (GdkImage*) private;
|
||||||
|
|
||||||
private->xdisplay = gdk_display;
|
private->xdisplay = gdk_display;
|
||||||
@ -412,7 +411,7 @@ gdk_image_destroy (GdkImage *image)
|
|||||||
shmdt (x_shm_info->shmaddr);
|
shmdt (x_shm_info->shmaddr);
|
||||||
shmctl (x_shm_info->shmid, IPC_RMID, 0);
|
shmctl (x_shm_info->shmid, IPC_RMID, 0);
|
||||||
|
|
||||||
g_free (private->x_shm_info);
|
free (private->x_shm_info);
|
||||||
|
|
||||||
image_list = g_list_remove (image_list, image);
|
image_list = g_list_remove (image_list, image);
|
||||||
#else /* USE_SHM */
|
#else /* USE_SHM */
|
||||||
@ -424,7 +423,7 @@ gdk_image_destroy (GdkImage *image)
|
|||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free (image);
|
free (image);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user