diff options
author | Egbert Eich <eich@freedesktop.org> | 2004-03-30 14:23:12 +0000 |
---|---|---|
committer | Egbert Eich <eich@freedesktop.org> | 2004-03-30 14:23:12 +0000 |
commit | 90b6f32bbe219045cebe7927b55261d63583fa06 (patch) | |
tree | 42970d79316223cb78b541b89f1d71f6a91ec9ea | |
parent | b82e8b257b7f76c3cba137401077d6d448678113 (diff) |
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).XORG-CURRENT-premerge-release-1
-rw-r--r-- | include/X11/Xlibint.h | 1 | ||||
-rw-r--r-- | src/GetDflt.c | 5 | ||||
-rw-r--r-- | src/OpenDis.c | 3 | ||||
-rw-r--r-- | src/Xrm.c | 5 |
4 files changed, 11 insertions, 3 deletions
diff --git a/include/X11/Xlibint.h b/include/X11/Xlibint.h index eaa97388..c1966ada 100644 --- a/include/X11/Xlibint.h +++ b/include/X11/Xlibint.h @@ -386,6 +386,7 @@ extern LockInfoPtr _Xglobal_lock; #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. diff --git a/src/GetDflt.c b/src/GetDflt.c index 6146ca49..3c7ba344 100644 --- a/src/GetDflt.c +++ b/src/GetDflt.c @@ -239,8 +239,9 @@ XGetDefault( */ LockDisplay(dpy); if (dpy->db == NULL) { - dpy->db = InitDefaults(dpy); - } + dpy->db = InitDefaults(dpy); + dpy->flags |= XlibDisplayDfltRMDB; + } UnlockDisplay(dpy); names[0] = XrmStringToName(progname); diff --git a/src/OpenDis.c b/src/OpenDis.c index b5e2b49a..f9a148d7 100644 --- a/src/OpenDis.c +++ b/src/OpenDis.c @@ -761,7 +761,8 @@ void _XFreeDisplayStructure(dpy) 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) { @@ -348,6 +348,11 @@ void XrmSetDatabase( 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); } |