OSDN Git Service

nvdaHelper fake_createCompatibleDc: don't create a new displayModel if the real_creat...
authorMichael Curran <mick@kulgan.net>
Wed, 23 Mar 2011 01:46:15 +0000 (11:46 +1000)
committerMichael Curran <mick@kulgan.net>
Wed, 23 Mar 2011 01:46:15 +0000 (11:46 +1000)
nvdaHelper/remote/gdiHooks.cpp

index 3732d62..95a4684 100644 (file)
@@ -431,6 +431,7 @@ HDC WINAPI fake_CreateCompatibleDC(HDC hdc) {
        //If the creation was successful, and the DC that was used in the creation process is a window DC, \r
        //we should create a displayModel for this DC so that text writes can be tracked in case  its ever bit blitted to a window DC. \r
        //We also need to acquire access to the model maps while we do this\r
+       if(!newHdc) return NULL;\r
        displayModel_t* model=new displayModel_t();\r
        displayModelsByMemoryDC.acquire();\r
        displayModelsByMemoryDC.insert(make_pair(newHdc,model));\r