Displaying a window created with SDL_CreateWindowFrom was causing stack overflows for me under certain conditions. After far too much work trying to get Visual Studio’s debugger to play nice with a program written in Delphi, I tracked it down to a nasty reentrancy cycle in the WndProc handling. Here’s a patch that fixes the problem:
Index: SDL_win32events.c===================================================================
— SDL_win32events.c (revision 4462)
+++ SDL_win32events.c (working copy)
@@ -570,6 +570,17 @@
}
return (0);
-
/* If this isn't our window, we don't need to repaint the frame.
-
This fixes a reentrancy issue that can cause stack overflows with foreign windows.
-
3/21/09 Mason Wheeler */
- case WM_NCPAINT:
-
{
-
if (SDL_GetWindowFlags(data->windowID) && SDL_WINDOW_FOREIGN) {
-
return(0);
-
}
-
break;
-
}
-
/* We'll do our own drawing, prevent flicker */
case WM_ERASEBKGND:
{
Displaying a window created with SDL_CreateWindowFrom was causing stack overflows for me under certain conditions. After far too much work trying to get Visual Studio’s debugger to play nice with a program written in Delphi, I tracked it down to a nasty reentrancy cycle in the WndProc handling. Here’s a patch that fixes the problem:
Thanks, this is in subversion!
See ya,
-Sam Lantinga, Founder and President, Galaxy Gameworks LLC
Displaying a window created with SDL_CreateWindowFrom was causing stack overflows for me under certain conditions. After far too much work trying to get Visual Studio’s debugger to play nice with a program written in Delphi, I tracked it down to a nasty reentrancy cycle in the WndProc handling. Here’s a patch that fixes the problem:
Thanks! This patch is applied to subversion.
See ya,
-Sam Lantinga, Founder and President, Galaxy Gameworks LLC
Are you sure you don’t want & instead of && ?On Sun, Mar 22, 2009 at 3:41 AM, Mason Wheeler wrote:
Displaying a window created with SDL_CreateWindowFrom was causing stack
overflows for me under certain conditions. After far too much work trying
to get Visual Studio’s debugger to play nice with a program written in
Delphi, I tracked it down to a nasty reentrancy cycle in the WndProc
handling. Here’s a patch that fixes the problem:
Index: SDL_win32events.c
— SDL_win32events.c (revision 4462)
+++ SDL_win32events.c (working copy)
@@ -570,6 +570,17 @@
}
return (0);
-
/* If this isn't our window, we don't need to repaint the frame.
-
This fixes a reentrancy issue that can cause stack overflows
with foreign windows.
{
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
You know, you’re probably right. grumbles about crazy languages with two different ANDs>________________________________
From: David Turner
Subject: Re: [SDL] Critical SDL 1.3 patch
Are you sure you don’t want & instead of && ?