//---------------------------------------------------------------------------
	void GLSLESProgram::unloadImpl()
	{   
		// We didn't create mAssemblerProgram through a manager, so override this
		// implementation so that we don't try to remove it from one. Since getCreator()
		// is used, it might target a different matching handle!
		mAssemblerProgram.setNull();

		unloadHighLevel();
	}
    //---------------------------------------------------------------------------
    void HighLevelGpuProgram::unloadImpl()
    {   
        if (!mAssemblerProgram.isNull() && mAssemblerProgram.getPointer() != this)
        {
            mAssemblerProgram->getCreator()->remove(mAssemblerProgram->getHandle());
            mAssemblerProgram.setNull();
        }

        unloadHighLevel();
		resetCompileError();
    }
Ejemplo n.º 3
0
//---------------------------------------------------------------------------
GLSLESProgram::~GLSLESProgram()
{
    // Have to call this here reather than in Resource destructor
    // since calling virtual methods in base destructors causes crash
    if (isLoaded())
    {
        unload();
    }
    else
    {
        unloadHighLevel();
    }
}
Ejemplo n.º 4
0
	//-----------------------------------------------------------------------
	D3D10HLSLProgram::~D3D10HLSLProgram()
	{
		SAFE_RELEASE(mConstantBuffer);

		// this is a hack - to solve that problem that we are the mAssemblerProgram of ourselves
		*(mAssemblerProgram.useCountPointer()) = 0;
		mAssemblerProgram.setNull();

		// have to call this here reather than in Resource destructor
		// since calling virtual methods in base destructors causes crash
		if (isLoaded())
		{
			unload();
		}
		else
		{
			unloadHighLevel();
		}
	}