Source/ThirdParty/ANGLE/src/libGLESv2/Program.cpp
void Program::unlink(bool destroy)
{
    if (destroy)   // Object being destructed
    {
        if (mFragmentShader)
        {
            mFragmentShader->release();
            mFragmentShader = NULL;
        }

        if (mVertexShader)
        {
            mVertexShader->release();
            mVertexShader = NULL;
        }
    }

    if (mPixelExecutable)
    {
        mPixelExecutable->Release();
        mPixelExecutable = NULL;
    }

    if (mVertexExecutable)
    {
        mVertexExecutable->Release();
        mVertexExecutable = NULL;
    }

    if (mConstantTablePS)
    {
        mConstantTablePS->Release();
        mConstantTablePS = NULL;
    }

    if (mConstantTableVS)
    {
        mConstantTableVS->Release();
        mConstantTableVS = NULL;
    }

    for (int index = 0; index < MAX_VERTEX_ATTRIBS; index++)
    {
        mLinkedAttribute[index].name.clear();
        mSemanticIndex[index] = -1;
    }

    for (int index = 0; index < MAX_TEXTURE_IMAGE_UNITS; index++)
    {
        mSamplers[index].active = false;
        mSamplers[index].dirty = true;
    }

    while (!mUniforms.empty())
    {
        delete mUniforms.back();
        mUniforms.pop_back();
    }

    mDxDepthRangeLocation = -1;
    mDxDepthLocation = -1;
    mDxViewportLocation = -1;
    mDxHalfPixelSizeLocation = -1;
    mDxFrontCCWLocation = -1;
    mDxPointsOrLinesLocation = -1;

    mUniformIndex.clear();

    mPixelHLSL.clear();
    mVertexHLSL.clear();

    delete[] mInfoLog;
    mInfoLog = NULL;

    mLinked = false;
}
// Returns the program object to an unlinked state, after detaching a shader, before re-linking, or at destruction
Returns the program object to an unlinked state, after detaching a shader, before re-linking, or at destruction
Returns the program object to an unlinked state after detaching a shader before re - linking or at destruction
void Program::unlink(bool destroy)
{
    if (destroy)   
    {
        if (mFragmentShader)
        {
            mFragmentShader->release();
            mFragmentShader = NULL;
        }
        if (mVertexShader)
        {
            mVertexShader->release();
            mVertexShader = NULL;
        }
    }
    if (mPixelExecutable)
    {
        mPixelExecutable->Release();
        mPixelExecutable = NULL;
    }
    if (mVertexExecutable)
    {
        mVertexExecutable->Release();
        mVertexExecutable = NULL;
    }
    if (mConstantTablePS)
    {
        mConstantTablePS->Release();
        mConstantTablePS = NULL;
    }
    if (mConstantTableVS)
    {
        mConstantTableVS->Release();
        mConstantTableVS = NULL;
    }
    for (int index = 0; index < MAX_VERTEX_ATTRIBS; index++)
    {
        mLinkedAttribute[index].name.clear();
        mSemanticIndex[index] = -1;
    }
    for (int index = 0; index < MAX_TEXTURE_IMAGE_UNITS; index++)
    {
        mSamplers[index].active = false;
        mSamplers[index].dirty = true;
    }
    while (!mUniforms.empty())
    {
        delete mUniforms.back();
        mUniforms.pop_back();
    }
    mDxDepthRangeLocation = -1;
    mDxDepthLocation = -1;
    mDxViewportLocation = -1;
    mDxHalfPixelSizeLocation = -1;
    mDxFrontCCWLocation = -1;
    mDxPointsOrLinesLocation = -1;
    mUniformIndex.clear();
    mPixelHLSL.clear();
    mVertexHLSL.clear();
    delete[] mInfoLog;
    mInfoLog = NULL;
    mLinked = false;
}
void Program :: unlink ( bool destroy ) { if ( destroy ) { if ( mFragmentShader ) { mFragmentShader -> release ( ) ; mFragmentShader = NULL ; } if ( mVertexShader ) { mVertexShader -> release ( ) ; mVertexShader = NULL ; } } if ( mPixelExecutable ) { mPixelExecutable -> Release ( ) ; mPixelExecutable = NULL ; } if ( mVertexExecutable ) { mVertexExecutable -> Release ( ) ; mVertexExecutable = NULL ; } if ( mConstantTablePS ) { mConstantTablePS -> Release ( ) ; mConstantTablePS = NULL ; } if ( mConstantTableVS ) { mConstantTableVS -> Release ( ) ; mConstantTableVS = NULL ; } for ( int index = 0 ; index < MAX_VERTEX_ATTRIBS ; index ++ ) { mLinkedAttribute [ index ] . name . clear ( ) ; mSemanticIndex [ index ] = -1 ; } for ( int index = 0 ; index < MAX_TEXTURE_IMAGE_UNITS ; index ++ ) { mSamplers [ index ] . active = false ; mSamplers [ index ] . dirty = true ; } while ( ! mUniforms . empty ( ) ) { delete mUniforms . back ( ) ; mUniforms . pop_back ( ) ; } mDxDepthRangeLocation = -1 ; mDxDepthLocation = -1 ; mDxViewportLocation = -1 ; mDxHalfPixelSizeLocation = -1 ; mDxFrontCCWLocation = -1 ; mDxPointsOrLinesLocation = -1 ; mUniformIndex . clear ( ) ; mPixelHLSL . clear ( ) ; mVertexHLSL . clear ( ) ; delete [ ] mInfoLog ; mInfoLog = NULL ; mLinked = false ; }
Returns the program object to an unlinked state, after detaching a shader, before re-linking, or at destruction
Returns the program object to an unlinked state after detaching a shader before re - linking or at destruction
// Object being destructed