mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-23 21:03:08 +09:00
Use WeakPtr for extension parent pointer.
This commit is contained in:
parent
a10e2214ee
commit
08ccf18274
8 changed files with 55 additions and 33 deletions
|
|
@ -25,7 +25,7 @@ WebGLExtensionVertexArray::~WebGLExtensionVertexArray()
|
|||
already_AddRefed<WebGLVertexArray>
|
||||
WebGLExtensionVertexArray::CreateVertexArrayOES()
|
||||
{
|
||||
if (mIsLost)
|
||||
if (mIsLost || !mContext)
|
||||
return nullptr;
|
||||
|
||||
return mContext->CreateVertexArray();
|
||||
|
|
@ -34,7 +34,7 @@ WebGLExtensionVertexArray::CreateVertexArrayOES()
|
|||
void
|
||||
WebGLExtensionVertexArray::DeleteVertexArrayOES(WebGLVertexArray* array)
|
||||
{
|
||||
if (mIsLost)
|
||||
if (mIsLost || !mContext)
|
||||
return;
|
||||
|
||||
mContext->DeleteVertexArray(array);
|
||||
|
|
@ -43,7 +43,7 @@ WebGLExtensionVertexArray::DeleteVertexArrayOES(WebGLVertexArray* array)
|
|||
bool
|
||||
WebGLExtensionVertexArray::IsVertexArrayOES(const WebGLVertexArray* array)
|
||||
{
|
||||
if (mIsLost)
|
||||
if (mIsLost || !mContext)
|
||||
return false;
|
||||
|
||||
return mContext->IsVertexArray(array);
|
||||
|
|
@ -52,7 +52,7 @@ WebGLExtensionVertexArray::IsVertexArrayOES(const WebGLVertexArray* array)
|
|||
void
|
||||
WebGLExtensionVertexArray::BindVertexArrayOES(WebGLVertexArray* array)
|
||||
{
|
||||
if (mIsLost)
|
||||
if (mIsLost || !mContext)
|
||||
return;
|
||||
|
||||
mContext->BindVertexArray(array);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue