tooltips: do not free LPSTR_TEXTCALLBACK texts

Rein Klazes wijn at wanadoo.nl
Thu Mar 23 04:29:44 CST 2006


Hi,

Getting rid of:
  err:heap:GlobalFree page fault occurred ! Caused by bug ?
in bug report #4664

Changelog:
dlls/comctl32	: tooltips.c
Do not free LPSTR_TEXTCALLBACK tooltip texts.

Rein.
-------------- next part --------------
--- wine/dlls/comctl32/tooltips.c	2005-12-19 21:24:03.000000000 +0100
+++ mywine/dlls/comctl32/tooltips.c	2006-03-23 09:00:59.000000000 +0100
@@ -2025,7 +2025,8 @@ TOOLTIPS_SetToolInfoA (HWND hwnd, WPARAM
 	else {
 	    if ( (toolPtr->lpszText) &&
 		 !IS_INTRESOURCE(toolPtr->lpszText) ) {
-		Free (toolPtr->lpszText);
+		if( toolPtr->lpszText != LPSTR_TEXTCALLBACKW)
+                    Free (toolPtr->lpszText);
 		toolPtr->lpszText = NULL;
 	    }
 	    if (lpToolInfo->lpszText) {
@@ -2082,7 +2083,8 @@ TOOLTIPS_SetToolInfoW (HWND hwnd, WPARAM
 	else {
 	    if ( (toolPtr->lpszText) &&
 		 !IS_INTRESOURCE(toolPtr->lpszText) ) {
-		Free (toolPtr->lpszText);
+		if( toolPtr->lpszText != LPSTR_TEXTCALLBACKW)
+                    Free (toolPtr->lpszText);
 		toolPtr->lpszText = NULL;
 	    }
 	    if (lpToolInfo->lpszText) {
@@ -2208,7 +2210,8 @@ TOOLTIPS_UpdateTipTextA (HWND hwnd, WPAR
 	else {
 	    if ( (toolPtr->lpszText) &&
 		 !IS_INTRESOURCE(toolPtr->lpszText) ) {
-		Free (toolPtr->lpszText);
+		if( toolPtr->lpszText != LPSTR_TEXTCALLBACKW)
+                    Free (toolPtr->lpszText);
 		toolPtr->lpszText = NULL;
 	    }
 	    if (lpToolInfo->lpszText) {
@@ -2265,7 +2268,8 @@ TOOLTIPS_UpdateTipTextW (HWND hwnd, WPAR
 	else {
 	    if ( (toolPtr->lpszText)  &&
 		 !IS_INTRESOURCE(toolPtr->lpszText) ) {
-		Free (toolPtr->lpszText);
+		if( toolPtr->lpszText != LPSTR_TEXTCALLBACKW)
+                    Free (toolPtr->lpszText);
 		toolPtr->lpszText = NULL;
 	    }
 	    if (lpToolInfo->lpszText) {


More information about the wine-patches mailing list