[xorg-commit-diffs] xc/lib/X11 GetDflt.c, 1.1.4.3, 1.1.4.4 OpenDis.c, 1.1.4.3, 1.1.4.4 Xlibint.h, 1.1.4.5, 1.1.4.6 Xrm.c, 1.1.4.3, 1.1.4.4

Egbert Eich xorg-commit at pdx.freedesktop.org
Tue Mar 30 06:23:45 PST 2004


Committed by: eich

Update of /cvs/xorg/xc/lib/X11
In directory pdx:/tmp/cvs-serv15785/lib/X11

Modified Files:
      Tag: XORG-CURRENT
	GetDflt.c OpenDis.c Xlibint.h Xrm.c 
Log Message:
  36.  Conversion: __AMD64__ > __amd64__ (Egbert Eich).
  35.  Fixed stretching option and centering in C&T driver (Egbert Eich).
  34.  Added support for memory size tweaking in BIOS for i845 (Egbert Eich,
       thanks to Christian Ziez)
  33.  Removed video playback dependency on Accel in NSC drivers (Egbert
  3Eich).
  32.  Fix HW cursor state on Savage driver when entering VT as some
       BIOSes seem to enable it unconditionally (Egbert Eich).
  31.  Fixed Emulate3Button message to distinguish between 'hard' (ie.
       configured) and 'soft' (ie. automatic emulation that is disabled as
       soon as the  middle button is pressed) (Egbert Eich).
  30.  Free XrmDB in XCloseDisplay() only when implicitely allocated by
       XGetDefaults(). If Client allocates it itself it should free it also.
       Trying to free it for the client may result in segfault if the client
       has already freed it (Egbert Eich).



Index: GetDflt.c
===================================================================
RCS file: /cvs/xorg/xc/lib/X11/GetDflt.c,v
retrieving revision 1.1.4.3
retrieving revision 1.1.4.4
diff -u -d -r1.1.4.3 -r1.1.4.4
--- a/GetDflt.c	5 Mar 2004 13:39:07 -0000	1.1.4.3
+++ b/GetDflt.c	30 Mar 2004 14:23:12 -0000	1.1.4.4
@@ -239,8 +239,9 @@
 	 */
 	LockDisplay(dpy);
 	if (dpy->db == NULL) {
-		dpy->db = InitDefaults(dpy);
-		}
+	    dpy->db = InitDefaults(dpy);
+	    dpy->flags |= XlibDisplayDfltRMDB;
+	}
 	UnlockDisplay(dpy);
 
 	names[0] = XrmStringToName(progname);

Index: OpenDis.c
===================================================================
RCS file: /cvs/xorg/xc/lib/X11/OpenDis.c,v
retrieving revision 1.1.4.3
retrieving revision 1.1.4.4
diff -u -d -r1.1.4.3 -r1.1.4.4
--- a/OpenDis.c	5 Mar 2004 13:39:07 -0000	1.1.4.3
+++ b/OpenDis.c	30 Mar 2004 14:23:12 -0000	1.1.4.4
@@ -761,7 +761,8 @@
 	if (dpy->xkb_info)
 	   (*dpy->free_funcs->xkb)(dpy);
 
-	if (dpy->db)
+	/* if RM database was allocated by XGetDefault() free it */
+	if (dpy->db && (dpy->flags & XlibDisplayDfltRMDB))
 	    XrmDestroyDatabase(dpy->db);
 
 	if (dpy->screens) {

Index: Xlibint.h
===================================================================
RCS file: /cvs/xorg/xc/lib/X11/Xlibint.h,v
retrieving revision 1.1.4.5
retrieving revision 1.1.4.6
diff -u -d -r1.1.4.5 -r1.1.4.6
--- a/Xlibint.h	5 Mar 2004 13:39:08 -0000	1.1.4.5
+++ b/Xlibint.h	30 Mar 2004 14:23:12 -0000	1.1.4.6
@@ -386,6 +386,7 @@
 #define XlibDisplayReadEvents	(1L << 5) /* in _XReadEvents */
 #define XlibDisplayReply	(1L << 5) /* in _XReply */
 #define XlibDisplayWriting	(1L << 6) /* in _XFlushInt, _XSend */
+#define XlibDisplayDfltRMDB     (1L << 7) /* mark if RM db from XGetDefault */
 
 /*
  * X Protocol packetizing macros.

Index: Xrm.c
===================================================================
RCS file: /cvs/xorg/xc/lib/X11/Xrm.c,v
retrieving revision 1.1.4.3
retrieving revision 1.1.4.4
diff -u -d -r1.1.4.3 -r1.1.4.4
--- a/Xrm.c	5 Mar 2004 13:39:08 -0000	1.1.4.3
+++ b/Xrm.c	30 Mar 2004 14:23:12 -0000	1.1.4.4
@@ -348,6 +348,11 @@
     XrmDatabase database)
 {
     LockDisplay(display);
+    /* destroy database if set up imlicitely by XGetDefault() */
+    if (display->db && (display->flags & XlibDisplayDfltRMDB)) {
+	XrmDestroyDatabase(display->db);
+	display->flags &= ~XlibDisplayDfltRMDB;
+    }
     display->db = database;
     UnlockDisplay(display);
 }




More information about the xorg-commit-diffs mailing list