[xorg-commit-diffs] xc/programs/Xserver/hw/xwin winwin32rootless.c, 1.1.2.10, 1.1.2.11 winwin32rootlesswindow.c, 1.1.2.6, 1.1.2.7

Kensuke Matsuzaki xorg-commit at pdx.freedesktop.org
Wed Apr 14 21:17:44 PDT 2004


Committed by: zakki

Update of /cvs/xorg/xc/programs/Xserver/hw/xwin
In directory pdx:/tmp/cvs-serv10273

Modified Files:
      Tag: CYGWIN
	winwin32rootless.c winwin32rootlesswindow.c 
Log Message:
Fix debug message. Fix GDI leak because of off-by-one class namingm problem and DeleteObject instead of DestroyIcon.


Index: winwin32rootless.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/Attic/winwin32rootless.c,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -u -d -r1.1.2.10 -r1.1.2.11
--- a/winwin32rootless.c	14 Apr 2004 06:12:44 -0000	1.1.2.10
+++ b/winwin32rootless.c	15 Apr 2004 04:17:41 -0000	1.1.2.11
@@ -271,7 +271,7 @@
     hIcon = g_hiconX;
 
   /* Set standard class name prefix so we can identify window easily */
-  strncpy (pszClass, WINDOW_CLASS_X, strlen (WINDOW_CLASS_X));
+  strncpy (pszClass, WINDOW_CLASS_X, sizeof(pszClass));
 
   if (winMultiWindowGetClassHint (pFrame->win, &res_name, &res_class))
     {
@@ -414,7 +414,7 @@
   /* Store the info we need to destroy after this window is gone */
   hInstance = (HINSTANCE) GetClassLong (pRLWinPriv->hWnd, GCL_HMODULE);
   hiconClass = (HICON) GetClassLong (pRLWinPriv->hWnd, GCL_HICON);
-  iReturn = GetClassName (pRLWinPriv->hWnd, pszClass, 512);
+  iReturn = GetClassName (pRLWinPriv->hWnd, pszClass, CLASS_NAME_LENGTH);
 
   pRLWinPriv->fClose = TRUE;
   pRLWinPriv->fDestroyed = TRUE;
@@ -426,21 +426,21 @@
   if (iReturn)
     { 
 #if CYGMULTIWINDOW_DEBUG
-      ErrorF ("winDestroyWindowsWindow - Unregistering %s: ", pszClass);
+      ErrorF ("winMWExtWMDestroyFrame - Unregistering %s: ", pszClass);
 #endif
       iReturn = UnregisterClass (pszClass, hInstance);
       
 #if CYGMULTIWINDOW_DEBUG
-      ErrorF ("winDestroyWindowsWindow - %d Deleting Icon: ", iReturn);
+      ErrorF ("winMWExtWMDestroyFramew - %d Deleting Icon: ", iReturn);
 #endif
       
       /* Only delete if it's not the default */
-      if (hiconClass != g_hiconX &&
+      if ((hiconClass != g_hiconX) &&
 	  !winIconIsOverride((unsigned long)hiconClass))
 	{ 
 	  iReturn = DestroyIcon (hiconClass);
 #if CYGMULTIWINDOW_DEBUG
-	  ErrorF ("winDestroyWindowsWindow - %d\n", iReturn);
+	  ErrorF ("winMWExtWMDestroyFrame - %d\n", iReturn);
 #endif
 	}
     }

Index: winwin32rootlesswindow.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/Attic/winwin32rootlesswindow.c,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -d -r1.1.2.6 -r1.1.2.7
--- a/winwin32rootlesswindow.c	9 Apr 2004 05:52:50 -0000	1.1.2.6
+++ b/winwin32rootlesswindow.c	15 Apr 2004 04:17:41 -0000	1.1.2.7
@@ -189,7 +189,7 @@
 	  /* Delete the icon if its not the default */
 	  if (hiconOld != g_hiconX &&
 	      !winIconIsOverride((unsigned long)hiconOld))
-	    DeleteObject (hiconOld);
+	    DestroyIcon (hiconOld);
 	}
     }
 }




More information about the xorg-commit-diffs mailing list