Index: Source/modules/webgl/WebGLRenderbuffer.cpp |
diff --git a/Source/modules/webgl/WebGLRenderbuffer.cpp b/Source/modules/webgl/WebGLRenderbuffer.cpp |
index 20183939e83b3af98756782189ae3dd78c874a1b..941e8b781662e8aced82720659f02920d2b6e3c5 100644 |
--- a/Source/modules/webgl/WebGLRenderbuffer.cpp |
+++ b/Source/modules/webgl/WebGLRenderbuffer.cpp |
@@ -31,17 +31,24 @@ |
namespace blink { |
-WebGLRenderbuffer* WebGLRenderbuffer::create(WebGLRenderingContextBase* ctx) |
+PassRefPtrWillBeRawPtr<WebGLRenderbuffer> WebGLRenderbuffer::create(WebGLRenderingContextBase* ctx) |
{ |
- return new WebGLRenderbuffer(ctx); |
+ return adoptRefWillBeNoop(new WebGLRenderbuffer(ctx)); |
} |
WebGLRenderbuffer::~WebGLRenderbuffer() |
{ |
+#if ENABLE(OILPAN) |
// This render buffer (heap) object must finalize itself. |
m_emulatedStencilBuffer.clear(); |
- |
- // See the comment in WebGLObject::detachAndDeleteObject(). |
+#endif |
+ // Always call detach here to ensure that platform object deletion |
+ // happens with Oilpan enabled. It keeps the code regular to do it |
+ // with or without Oilpan enabled. |
+ // |
+ // See comment in WebGLBuffer's destructor for additional |
+ // information on why this is done for WebGLSharedObject-derived |
+ // objects. |
detachAndDeleteObject(); |
} |