summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/windows/gdi
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2003-11-04 23:37:53 +0000
committerBrian Paul <[email protected]>2003-11-04 23:37:53 +0000
commitafa6e978b9c74bcd013571a53aca47cbb8ca7b10 (patch)
treebfb0f739661d579cf60cad8660fda6533943356a /src/mesa/drivers/windows/gdi
parentf023391e1a18ffe714d7221168dc7566b97de14f (diff)
fix AccessViolation bug (#835861)
Diffstat (limited to 'src/mesa/drivers/windows/gdi')
-rw-r--r--src/mesa/drivers/windows/gdi/wmesa.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c
index 01b08e85094..b923c999416 100644
--- a/src/mesa/drivers/windows/gdi/wmesa.c
+++ b/src/mesa/drivers/windows/gdi/wmesa.c
@@ -1,4 +1,4 @@
-/* $Id: wmesa.c,v 1.1 2003/07/24 03:47:46 kschultz Exp $ */
+/* $Id: wmesa.c,v 1.2 2003/11/04 23:37:53 brianp Exp $ */
/*
* Windows (Win32) device driver for Mesa 3.4
@@ -2247,7 +2247,14 @@ void RemoveContext(HWND hWnd)
static LRESULT CALLBACK MyWndProc(HWND hwnd,UINT message,WPARAM wParam, LPARAM lParam)
{
- WMesaContext wc = Current->hwnd == hwnd ? Current : FindContext(hwnd);
+ WMesaContext wc;
+
+ if (Current==0 || Current->hwnd != hwnd)
+ wc=FindContext(hwnd);
+ else
+ wc=Current;
+
+
if( wc )
{
LRESULT lret = CallWindowProc((WNDPROC)(wc->oldWndProc),hwnd,message,wParam,lParam);