diff --git a/libs/hwui/jni/android_graphics_HardwareRenderer.cpp b/libs/hwui/jni/android_graphics_HardwareRenderer.cpp index b2ff38cc4e232..4d31cd90d40fc 100644 --- a/libs/hwui/jni/android_graphics_HardwareRenderer.cpp +++ b/libs/hwui/jni/android_graphics_HardwareRenderer.cpp @@ -247,7 +247,7 @@ static jlong android_view_ThreadedRenderer_createProxy(JNIEnv* env, jobject claz static void android_view_ThreadedRenderer_deleteProxy(JNIEnv* env, jobject clazz, jlong proxyPtr) { RenderProxy* proxy = reinterpret_cast(proxyPtr); - RenderProxy::asyncDelete(proxy); + delete proxy; } static jboolean android_view_ThreadedRenderer_loadSystemProperties(JNIEnv* env, jobject clazz, diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp index e538a92fbd97a..a77b5b5699075 100644 --- a/libs/hwui/renderthread/RenderProxy.cpp +++ b/libs/hwui/renderthread/RenderProxy.cpp @@ -26,7 +26,6 @@ #include "renderthread/CanvasContext.h" #include "renderthread/RenderTask.h" #include "renderthread/RenderThread.h" -#include "thread/CommonPool.h" #include "utils/Macros.h" #include "utils/TimeUtils.h" @@ -43,17 +42,6 @@ RenderProxy::RenderProxy(bool translucent, RenderNode* rootRenderNode, mDrawFrameTask.setContext(&mRenderThread, mContext, rootRenderNode); } -void RenderProxy::asyncDelete(RenderProxy* proxy) { - if (!proxy) return; - - if (proxy->mContext) { - // Use the common pool because ~RenderProxy blocks on calling into RenderThread - CommonPool::post([proxy]() { delete proxy; }); - } else { - delete proxy; - } -} - RenderProxy::~RenderProxy() { destroyContext(); } diff --git a/libs/hwui/renderthread/RenderProxy.h b/libs/hwui/renderthread/RenderProxy.h index 5f6b5cde652db..1b0f22e75a2de 100644 --- a/libs/hwui/renderthread/RenderProxy.h +++ b/libs/hwui/renderthread/RenderProxy.h @@ -62,14 +62,10 @@ enum { * references RenderProxy fields. This is safe as RenderProxy cannot * be deleted if it is blocked inside a call. */ -class RenderProxy final { +class RenderProxy { public: RenderProxy(bool opaque, RenderNode* rootNode, IContextFactory* contextFactory); - ~RenderProxy(); - - // Schedules a delete of the RenderProxy at a later date. Avoids blocking the current thread - // on destruction which ~RenderProxy does by default. - static void asyncDelete(RenderProxy*); + virtual ~RenderProxy(); // Won't take effect until next EGLSurface creation void setSwapBehavior(SwapBehavior swapBehavior);