diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2015-12-30 00:06:58 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2015-12-30 00:06:58 +0100 |
commit | 1391c0ad76cb1f8588a08f9350d2ba1fe98b8b6b (patch) | |
tree | c2d62e905a69bdbc787a6599b8b0f0e21fcdfe70 /nx-X11/programs/Xserver/randr/rrmode.c | |
parent | e4763fb4879ce8782e50c784ed9e7d8c5a1b7322 (diff) | |
parent | c4a388937baad8215f2650d746d3ddba4d4d1ee3 (diff) | |
download | nx-libs-1391c0ad76cb1f8588a08f9350d2ba1fe98b8b6b.tar.gz nx-libs-1391c0ad76cb1f8588a08f9350d2ba1fe98b8b6b.tar.bz2 nx-libs-1391c0ad76cb1f8588a08f9350d2ba1fe98b8b6b.zip |
Merge branch 'sunweaver-pr/xinerama-xrandr' into 3.6.x
Attributes GH PR #66: https://github.com/ArcticaProject/nx-libs/pull/66
Diffstat (limited to 'nx-X11/programs/Xserver/randr/rrmode.c')
-rw-r--r-- | nx-X11/programs/Xserver/randr/rrmode.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/nx-X11/programs/Xserver/randr/rrmode.c b/nx-X11/programs/Xserver/randr/rrmode.c index cb45bf74a..c3740b5f8 100644 --- a/nx-X11/programs/Xserver/randr/rrmode.c +++ b/nx-X11/programs/Xserver/randr/rrmode.c @@ -104,11 +104,13 @@ RRModeCreate (xRRModeInfo *modeInfo, } modes = newModes; modes[num_modes++] = mode; - /* * give the caller a reference to this mode */ ++mode->refcnt; +#ifdef DEBUG + fprintf(stderr, "RRModeCreate: num_modes [%d] new mode [%s] ([%p]) refcnt [%d]\n", num_modes, mode->name, mode, mode->refcnt); +#endif return mode; } @@ -144,11 +146,22 @@ RRModeGet (xRRModeInfo *modeInfo, !memcmp (name, mode->name, modeInfo->nameLength)) { ++mode->refcnt; +#ifdef DEBUG + fprintf(stderr, "RRModeGet: return existing mode [%s] ([%p]) refcnt [%d]\n", mode->name, mode, mode->refcnt); +#endif return mode; } } +#ifdef DEBUG + { + RRModePtr mode = RRModeCreate (modeInfo, name, NULL); + fprintf(stderr, "RRModeGet: return new mode [%s] ([%p]) refcnt [%d]\n", mode->name, mode, mode->refcnt); + return mode; + } +#else return RRModeCreate (modeInfo, name, NULL); +#endif } static RRModePtr @@ -252,8 +265,12 @@ RRModeDestroy (RRModePtr mode) { int m; - if (--mode->refcnt > 0) + if (--mode->refcnt > 0) { +#ifdef DEBUG + fprintf(stderr, "RRModeDestroy: mode [%s] ([%p]) refcnt [%d -> %d]\n", mode->name, mode, mode->refcnt + 1, mode->refcnt); +#endif return; + } for (m = 0; m < num_modes; m++) { if (modes[m] == mode) @@ -270,12 +287,18 @@ RRModeDestroy (RRModePtr mode) } } +#ifdef DEBUG + fprintf(stderr, "RRModeDestroy: destroyed mode [%s] ([%p])\n", mode->name, mode); +#endif xfree (mode); } static int RRModeDestroyResource (void * value, XID pid) { +#ifdef DEBUG + fprintf(stderr, "RRModeDestroyResource: mode [%s] ([%p]) refcnt [%d]\n", ((RRModePtr)value)->name, (RRModePtr)value, ((RRModePtr)value)->refcnt); +#endif RRModeDestroy ((RRModePtr) value); return 1; } |