Title: [95668] trunk/Source/WebCore
Revision
95668
Author
[email protected]
Date
2011-09-21 13:39:08 -0700 (Wed, 21 Sep 2011)

Log Message

[chromium] SharedGraphicsContext3D's context should not be destroyed during atexit
https://bugs.webkit.org/show_bug.cgi?id=68558

Reviewed by Stephen White.

The SharedGraphicsContext3D's internal context is lazily created and then leaked intentionally, but since the
last ref is in a function-static RefPtr<> it ends up being destroyed at process exit time.  This is bad, since
by the time we get this far in process shutdown we can't actually cleanly run the destruction logic and we
crash.  Since we are explicitly leaking this for the lifetime of the process there's no point in keeping it in a
RefPtr<>

* platform/graphics/gpu/SharedGraphicsContext3D.cpp:
(WebCore::SharedGraphicsContext3D::get):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (95667 => 95668)


--- trunk/Source/WebCore/ChangeLog	2011-09-21 20:13:57 UTC (rev 95667)
+++ trunk/Source/WebCore/ChangeLog	2011-09-21 20:39:08 UTC (rev 95668)
@@ -1,3 +1,19 @@
+2011-09-21  James Robinson  <[email protected]>
+
+        [chromium] SharedGraphicsContext3D's context should not be destroyed during atexit
+        https://bugs.webkit.org/show_bug.cgi?id=68558
+
+        Reviewed by Stephen White.
+
+        The SharedGraphicsContext3D's internal context is lazily created and then leaked intentionally, but since the
+        last ref is in a function-static RefPtr<> it ends up being destroyed at process exit time.  This is bad, since
+        by the time we get this far in process shutdown we can't actually cleanly run the destruction logic and we
+        crash.  Since we are explicitly leaking this for the lifetime of the process there's no point in keeping it in a
+        RefPtr<>
+
+        * platform/graphics/gpu/SharedGraphicsContext3D.cpp:
+        (WebCore::SharedGraphicsContext3D::get):
+
 2011-09-21  Sergey Glazunov  <[email protected]>
 
         [Chromium] Protect the Frame in V8HTMLDocument::openCallback

Modified: trunk/Source/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp (95667 => 95668)


--- trunk/Source/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp	2011-09-21 20:13:57 UTC (rev 95667)
+++ trunk/Source/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp	2011-09-21 20:39:08 UTC (rev 95668)
@@ -38,8 +38,8 @@
     attributes.antialias = false;
     attributes.canRecoverFromContextLoss = false; // Canvas contexts can not handle lost contexts.
     attributes.shareResources = true;
-    static RefPtr<GraphicsContext3D> context = GraphicsContext3D::create(attributes, 0);
-    return context.get();
+    static GraphicsContext3D* context = GraphicsContext3D::create(attributes, 0).leakRef();
+    return context;
 }
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to