unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] XCloseDisplay already calls XrmDestroyDatabase
@ 2008-08-19 10:19 İsmail Dönmez
  2008-08-20  8:17 ` İsmail Dönmez
  0 siblings, 1 reply; 10+ messages in thread
From: İsmail Dönmez @ 2008-08-19 10:19 UTC (permalink / raw)
  To: emacs- devel

[-- Attachment #1: Type: text/plain, Size: 1215 bytes --]

Hi,

Running on Ubuntu's upcoming Intrepid release I experienced X crashes
when I quit emacsclient. The gdb log shows XrmDestroyDatabase() is the
failing line. Looking at

src/xterm.c lines around about 10514:

#ifndef USE_X_TOOLKIT   /* I'm told Xt does this itself.  */
#ifndef AIX            /* On AIX, XCloseDisplay calls this.  */
  XrmDestroyDatabase (dpyinfo->xrdb);
#endif
#endif

So this code assumes only on AIX XCloseDisplay itself calls
XrmDestroyDatabase but this doesn't seem to be the case, looking at
libX11 1.1.4 source code,

src/OpenDis.c starting line 832:

    822     /* if RM database was allocated by XGetDefault() free it */
    823     if (dpy->db && (dpy->flags & XlibDisplayDfltRMDB))
    824         XrmDestroyDatabase(dpy->db);

this is from the _XFreeDisplayStructure() function and the function
documentation says:


 /* XFreeDisplayStructure frees all the storage associated with a
  * Display.  It is used by XOpenDisplay if it runs out of memory,
  * and also by XCloseDisplay.
....
*/

So looks like there is no need to manually call XrmDestroyDatabase()
anymore, attached patch removes it.

Regards,
ismail

-- 
Programmer Excuse #4: It's too complicated for you to understand.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: xrm.patch --]
[-- Type: text/x-diff; name=xrm.patch, Size: 444 bytes --]

diff --git a/src/xterm.c b/src/xterm.c
index a32f4e1..b5b3f19 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10514,11 +10514,6 @@ x_delete_display (dpyinfo)
 	  tail->next = tail->next->next;
     }
 
-#ifndef USE_X_TOOLKIT   /* I'm told Xt does this itself.  */
-#ifndef AIX		/* On AIX, XCloseDisplay calls this.  */
-  XrmDestroyDatabase (dpyinfo->xrdb);
-#endif
-#endif
 #ifdef HAVE_X_I18N
   if (dpyinfo->xim)
     xim_close_dpy (dpyinfo);

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-05-18 13:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-19 10:19 [PATCH] XCloseDisplay already calls XrmDestroyDatabase İsmail Dönmez
2008-08-20  8:17 ` İsmail Dönmez
2008-08-21 18:40   ` İsmail Dönmez
2008-08-21 19:43     ` Chong Yidong
2009-05-13  3:27       ` YAMAMOTO Mitsuharu
2009-05-13 23:48         ` YAMAMOTO Mitsuharu
2009-05-17 21:40           ` Stefan Monnier
2009-05-18  8:09             ` YAMAMOTO Mitsuharu
2009-05-18 13:29               ` Chong Yidong
2009-05-17 21:40         ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).