Changeset 95668 in webkit


Ignore:
Timestamp:
Sep 21, 2011 1:39:08 PM (13 years ago)
Author:
jamesr@google.com
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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r95667 r95668  
     12011-09-21  James Robinson  <jamesr@chromium.org>
     2
     3        [chromium] SharedGraphicsContext3D's context should not be destroyed during atexit
     4        https://bugs.webkit.org/show_bug.cgi?id=68558
     5
     6        Reviewed by Stephen White.
     7
     8        The SharedGraphicsContext3D's internal context is lazily created and then leaked intentionally, but since the
     9        last ref is in a function-static RefPtr<> it ends up being destroyed at process exit time.  This is bad, since
     10        by the time we get this far in process shutdown we can't actually cleanly run the destruction logic and we
     11        crash.  Since we are explicitly leaking this for the lifetime of the process there's no point in keeping it in a
     12        RefPtr<>
     13
     14        * platform/graphics/gpu/SharedGraphicsContext3D.cpp:
     15        (WebCore::SharedGraphicsContext3D::get):
     16
    1172011-09-21  Sergey Glazunov  <serg.glazunov@gmail.com>
    218
  • trunk/Source/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp

    r95658 r95668  
    3939    attributes.canRecoverFromContextLoss = false; // Canvas contexts can not handle lost contexts.
    4040    attributes.shareResources = true;
    41     static RefPtr<GraphicsContext3D> context = GraphicsContext3D::create(attributes, 0);
    42     return context.get();
     41    static GraphicsContext3D* context = GraphicsContext3D::create(attributes, 0).leakRef();
     42    return context;
    4343}
    4444
Note: See TracChangeset for help on using the changeset viewer.