summaryrefslogtreecommitdiffstats
path: root/unix/xserver/hw/vnc/XserverDesktop.cc
diff options
context:
space:
mode:
authorAdam Tkac <atkac@redhat.com>2008-10-15 13:23:24 +0000
committerAdam Tkac <atkac@redhat.com>2008-10-15 13:23:24 +0000
commit23bf1135a86e5b58b320b6f017baaa1965055821 (patch)
tree06f558bba1720face6d9bd3b51bb1c277b7056dd /unix/xserver/hw/vnc/XserverDesktop.cc
parent0ede62bd1238f27c8a04536e9ed0cbc2948eb3f5 (diff)
downloadtigervnc-23bf1135a86e5b58b320b6f017baaa1965055821.tar.gz
tigervnc-23bf1135a86e5b58b320b6f017baaa1965055821.zip
[Bugfix] Find correct colormap in XserverDesktop::serverReset method
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3020 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'unix/xserver/hw/vnc/XserverDesktop.cc')
-rw-r--r--unix/xserver/hw/vnc/XserverDesktop.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc
index 4ab9adc5..8dd4aa04 100644
--- a/unix/xserver/hw/vnc/XserverDesktop.cc
+++ b/unix/xserver/hw/vnc/XserverDesktop.cc
@@ -23,6 +23,7 @@
#include <dix-config.h>
#endif
+#include <assert.h>
#include <stdio.h>
#include <strings.h>
#include <unistd.h>
@@ -247,9 +248,16 @@ XserverDesktop::~XserverDesktop()
void XserverDesktop::serverReset(ScreenPtr pScreen_)
{
pScreen = pScreen_;
- XID* ids = new XID[pScreen->maxInstalledCmaps];
- cmap = (ColormapPtr)LookupIDByType(ids[0], RT_COLORMAP);
- delete [] ids;
+ int i;
+ pointer retval;
+
+ i = dixLookupResource(&retval, pScreen->defColormap, RT_COLORMAP, NullClient,
+ DixReadAccess);
+
+ /* Handle suspicious conditions */
+ assert(i != Success);
+
+ cmap = (ColormapPtr) retval;
}
char* XserverDesktop::substitute(const char* varName)