[Bf-committers] final patch for DRI crash

Jacek Popławski bf-committers@blender.org
Mon, 12 May 2003 05:38:15 +0200


--OgqxwSJOaUobr8KG
Content-Type: text/plain; charset=iso-8859-2
Content-Disposition: inline

This time patch should not break anything. I tracked crash on r200 DRI driver
when closing renderwin in Blender. I asked on DRI mailing list, and... got
answer! The problem is located in GHOST. r200 DRI driver crashes when function
XDestroyWindow is called before glXDestroyContext. I changed that in
intern/ghost/intern/GHOST_WindowX11.cpp, and got no more crashes.

*please* test this patch and try to apply if before 2.27 release.

-- 
Free Software - find interesting programs and change them
NetHack - meet interesting creatures, kill them and eat their bodies
Usenet - meet interesting people from all over the world and flame them
Decopter - unrealistic helicopter simulator, get it from http://decopter.sf.net

--OgqxwSJOaUobr8KG
Content-Type: text/plain; charset=iso-8859-2
Content-Disposition: attachment; filename="fixup_for_renderwin_crashes_on_DRI.diff"

diff -Naur blender/intern/ghost/intern/GHOST_WindowX11.cpp blender-fixed/intern/ghost/intern/GHOST_WindowX11.cpp
--- blender/intern/ghost/intern/GHOST_WindowX11.cpp	2003-01-01 19:11:26.000000000 +0100
+++ blender-fixed/intern/ghost/intern/GHOST_WindowX11.cpp	2003-05-12 05:26:20.000000000 +0200
@@ -492,13 +492,13 @@
 		XFreeCursor(m_display, m_custom_cursor);
 	}
 	
-	XDestroyWindow(m_display, m_window);
 	if (m_context) {
 		if (m_context == s_firstContext) {
 			s_firstContext = NULL;
 		}
 		glXDestroyContext(m_display, m_context);
 	}
+	XDestroyWindow(m_display, m_window);
 	XFree(m_visual);
 }
 

--OgqxwSJOaUobr8KG--