diff options
author | Owen Taylor <otaylor@redhat.com> | 1998-12-07 19:03:10 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1998-12-07 19:03:10 +0000 |
commit | d1045b68761137114109cd3c786e0f35f8d560c4 (patch) | |
tree | b0cf8b906f5b56afde5e6d2e67fb21fee91948e7 /gdk/gdkimage.c | |
parent | 139e3cd47da5a613a858d21e7baf75fd953af779 (diff) | |
download | gtk+-d1045b68761137114109cd3c786e0f35f8d560c4.tar.gz |
Use IPC_RMID _after_ doing XShmAttach. This should work everywhere, and
Mon Dec 7 13:38:06 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkimage.c (gdk_image_new): Use IPC_RMID
_after_ doing XShmAttach. This should work everywhere,
and avoid the need for signal handlers or configure
checks.
Diffstat (limited to 'gdk/gdkimage.c')
-rw-r--r-- | gdk/gdkimage.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gdk/gdkimage.c b/gdk/gdkimage.c index 8e62fef664..5d48182d93 100644 --- a/gdk/gdkimage.c +++ b/gdk/gdkimage.c @@ -235,11 +235,6 @@ gdk_image_new (GdkImageType type, return NULL; } -#ifdef IPC_RMID_DEFERRED_RELEASE - if (x_shm_info->shmaddr != (char*) -1) - shmctl (x_shm_info->shmid, IPC_RMID, 0); -#endif - gdk_error_code = 0; gdk_error_warnings = 0; @@ -260,6 +255,14 @@ gdk_image_new (GdkImageType type, gdk_use_xshm = False; return NULL; } + + /* We mark the segment as destroyed so that when + * the last process detaches, it will be deleted. + * There is a small possibility of leaking if + * we die in XShmAttach. In theory, a signal handler + * could be set up. + */ + shmctl (x_shm_info->shmid, IPC_RMID, 0); if (image) image_list = g_list_prepend (image_list, image); @@ -417,7 +420,6 @@ gdk_image_destroy (GdkImage *image) x_shm_info = private->x_shm_info; shmdt (x_shm_info->shmaddr); - shmctl (x_shm_info->shmid, IPC_RMID, 0); g_free (private->x_shm_info); |