[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] XCloseDisplay already calls XrmDestroyDatabase
From: |
İsmail Dönmez |
Subject: |
Re: [PATCH] XCloseDisplay already calls XrmDestroyDatabase |
Date: |
Thu, 21 Aug 2008 21:40:34 +0300 |
Hi,
On Wed, Aug 20, 2008 at 11:17, İsmail Dönmez <address@hidden> wrote:
> Hi again,
>
> On Tue, Aug 19, 2008 at 13:19, İsmail Dönmez <address@hidden> wrote:
>> 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.
>
> Actually correct solution is to disable XrmDestroyDatabase() call for
> GTK+ as done for Xt. See attached patch.
Any comments on this? It fixes a frequent crash for me.
Regards,
ismail
--
Programmer Excuse #4: It's too complicated for you to understand.