Skip to content

Commit

Permalink
fix(GLRender): null point crash
Browse files Browse the repository at this point in the history
  • Loading branch information
I-m-SuperMan committed Jun 18, 2020
1 parent 920337f commit 589c07c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions framework/render/video/glRender/GLRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,11 @@ int GLRender::VSyncOnInit()
void GLRender::VSyncOnDestroy()
{
mPrograms.clear();
assert(mContext != nullptr);

if(mContext == nullptr) {
return;
}

mContext->DestroyView();
mContext->DestroySurface(mGLSurface);
mGLSurface = nullptr;
Expand All @@ -274,6 +278,10 @@ void GLRender::VSyncOnDestroy()

bool GLRender::renderActually()
{
if(mContext == nullptr) {
return false;
}

if (mInBackground) {
// AF_LOGD("renderActurally .. InBackground ..");
return false;
Expand All @@ -293,7 +301,7 @@ bool GLRender::renderActually()
}

#endif
assert(mContext != nullptr);

bool displayViewChanged = false;
{
unique_lock<mutex> viewLock(mViewMutex);
Expand Down

0 comments on commit 589c07c

Please sign in to comment.