Changeset 205544 in webkit
- Timestamp:
- Sep 7, 2016 6:47:02 AM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r205542 r205544 1 2016-09-07 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Crash of WebProcess on the last WebView disconnect 4 https://bugs.webkit.org/show_bug.cgi?id=161605 5 6 Reviewed by Michael Catanzaro. 7 8 Stop tracking X11 GL contexts to be cleanered on an exit handler. This was added to work around bugs on drivers, 9 and it's assuming that all GLContext not deleted when the exit handler is called are leaked, which is no longer 10 true, because PlatformDisplay now owns a GLContext and is deleted after exit handlers. 11 12 * platform/graphics/GLContext.cpp: 13 (WebCore::GLContext::GLContext): 14 (WebCore::GLContext::~GLContext): 15 (WebCore::activeContextList): Deleted. 16 (WebCore::GLContext::addActiveContext): Deleted. 17 (WebCore::GLContext::removeActiveContext): Deleted. 18 (WebCore::GLContext::cleanupActiveContextsAtExit): Deleted. 19 1 20 2016-09-07 Nael Ouedraogo <nael.ouedraogo@crf.canon.fr> 2 21 -
trunk/Source/WebCore/platform/graphics/GLContext.cpp
r205116 r205544 54 54 return *ThreadGlobalGLContext::staticGLContext; 55 55 } 56 57 #if PLATFORM(X11)58 // Because of driver bugs, exiting the program when there are active pbuffers59 // can crash the X server (this has been observed with the official Nvidia drivers).60 // We need to ensure that we clean everything up on exit. There are several reasons61 // that GraphicsContext3Ds will still be alive at exit, including user error (memory62 // leaks) and the page cache. In any case, we don't want the X server to crash.63 typedef Vector<GLContext*> ActiveContextList;64 static ActiveContextList& activeContextList()65 {66 DEPRECATED_DEFINE_STATIC_LOCAL(ActiveContextList, activeContexts, ());67 return activeContexts;68 }69 70 void GLContext::addActiveContext(GLContext* context)71 {72 static bool addedAtExitHandler = false;73 if (!addedAtExitHandler) {74 atexit(&GLContext::cleanupActiveContextsAtExit);75 addedAtExitHandler = true;76 }77 activeContextList().append(context);78 }79 80 static bool gCleaningUpAtExit = false;81 82 void GLContext::removeActiveContext(GLContext* context)83 {84 // If we are cleaning up the context list at exit, don't bother removing the context85 // from the list, since we don't want to modify the list while it's being iterated.86 if (gCleaningUpAtExit)87 return;88 89 ActiveContextList& contextList = activeContextList();90 size_t i = contextList.find(context);91 if (i != notFound)92 contextList.remove(i);93 }94 95 void GLContext::cleanupActiveContextsAtExit()96 {97 gCleaningUpAtExit = true;98 99 ActiveContextList& contextList = activeContextList();100 for (size_t i = 0; i < contextList.size(); ++i)101 delete contextList[i];102 }103 #endif // PLATFORM(X11)104 56 105 57 static bool initializeOpenGLShimsIfNeeded() … … 179 131 : m_display(display) 180 132 { 181 #if PLATFORM(X11)182 if (display.type() == PlatformDisplay::Type::X11)183 addActiveContext(this);184 #endif185 133 } 186 134 … … 189 137 if (this == currentContext()->context()) 190 138 currentContext()->setContext(nullptr); 191 #if PLATFORM(X11)192 if (m_display.type() == PlatformDisplay::Type::X11)193 removeActiveContext(this);194 #endif195 139 } 196 140
Note: See TracChangeset
for help on using the changeset viewer.