Title: [156893] trunk/Source/WebCore
Revision
156893
Author
[email protected]
Date
2013-10-04 09:15:34 -0700 (Fri, 04 Oct 2013)

Log Message

[Win][WebGL] Crash on exit
https://bugs.webkit.org/show_bug.cgi?id=120764

Patch by [email protected] <[email protected]> on 2013-10-04
Reviewed by Martin Robinson.

On exit, libGLESv2.dll is detached from the process and relevant memory is released
before the atexit GL context cleanup handler is called, causing a NULL pointer crash.
The GL context cleanup code was originally written to avoid a X server crash on exit,
so it's only needed for PLATFORM(X11).

* platform/graphics/GLContext.cpp: Only clean up active GL contexts on exit for PLATFORM(X11).
(WebCore::GLContext::cleanupSharedX11Display):
(WebCore::GLContext::cleanupActiveContextsAtExit):
(WebCore::GLContext::GLContext):
(WebCore::GLContext::~GLContext):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (156892 => 156893)


--- trunk/Source/WebCore/ChangeLog	2013-10-04 16:14:06 UTC (rev 156892)
+++ trunk/Source/WebCore/ChangeLog	2013-10-04 16:15:34 UTC (rev 156893)
@@ -1,3 +1,21 @@
+2013-10-04  [email protected]  <[email protected]>
+
+        [Win][WebGL] Crash on exit
+        https://bugs.webkit.org/show_bug.cgi?id=120764
+
+        Reviewed by Martin Robinson.
+
+        On exit, libGLESv2.dll is detached from the process and relevant memory is released
+        before the atexit GL context cleanup handler is called, causing a NULL pointer crash.
+        The GL context cleanup code was originally written to avoid a X server crash on exit,
+        so it's only needed for PLATFORM(X11).
+
+        * platform/graphics/GLContext.cpp: Only clean up active GL contexts on exit for PLATFORM(X11).
+        (WebCore::GLContext::cleanupSharedX11Display):
+        (WebCore::GLContext::cleanupActiveContextsAtExit):
+        (WebCore::GLContext::GLContext):
+        (WebCore::GLContext::~GLContext):
+
 2013-10-04  Mihnea Ovidenie  <[email protected]>
 
         [CSSRegions] Regions as stacking contexts should paint over positioned sibling

Modified: trunk/Source/WebCore/platform/graphics/GLContext.cpp (156892 => 156893)


--- trunk/Source/WebCore/platform/graphics/GLContext.cpp	2013-10-04 16:14:06 UTC (rev 156892)
+++ trunk/Source/WebCore/platform/graphics/GLContext.cpp	2013-10-04 16:15:34 UTC (rev 156893)
@@ -93,7 +93,6 @@
     XCloseDisplay(gSharedX11Display);
     gSharedX11Display = 0;
 }
-#endif // PLATFORM(X11)
 
 // Because of driver bugs, exiting the program when there are active pbuffers
 // can crash the X server (this has been observed with the official Nvidia drivers).
@@ -140,13 +139,11 @@
     for (size_t i = 0; i < contextList.size(); ++i)
         delete contextList[i];
 
-#if PLATFORM(X11)
     cleanupSharedX11Display();
-#endif
 }
+#endif // PLATFORM(X11)
 
 
-
 PassOwnPtr<GLContext> GLContext::createContextForWindow(GLNativeWindowType windowHandle, GLContext* sharingContext)
 {
 #if PLATFORM(GTK) && defined(GDK_WINDOWING_WAYLAND) && USE(EGL)
@@ -174,7 +171,9 @@
 
 GLContext::GLContext()
 {
+#if PLATFORM(X11)
     addActiveContext(this);
+#endif
 }
 
 PassOwnPtr<GLContext> GLContext::createOffscreenContext(GLContext* sharingContext)
@@ -186,7 +185,9 @@
 {
     if (this == currentContext()->context())
         currentContext()->setContext(0);
+#if PLATFORM(X11)
     removeActiveContext(this);
+#endif
 }
 
 bool GLContext::makeContextCurrent()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to