瀏覽代碼

Fix a crash on exit caused by shader deletion.

legacy
Sam Hocevar 5 年之前
父節點
當前提交
00d7d2a774
共有 2 個檔案被更改,包括 1 行新增6 行删除
  1. +1
    -1
      src/lol/gpu/shader.h
  2. +0
    -5
      src/mesh/mesh.cpp

+ 1
- 1
src/lol/gpu/shader.h 查看文件

@@ -314,7 +314,7 @@ private:
class ShaderData;

//Shader ----------------------------------------------------------------------
class Shader : public Entity
class Shader
{
public:
static std::shared_ptr<Shader> Create(std::string const &name, std::string const &code);


+ 0
- 5
src/mesh/mesh.cpp 查看文件

@@ -61,13 +61,10 @@ SubMesh::SubMesh(std::shared_ptr<Shader> shader, std::shared_ptr<VertexDeclarati
m_shader(shader),
m_vdecl(vdecl)
{
Ticker::Ref(m_shader.get());
}

SubMesh::~SubMesh()
{
Ticker::Unref(m_shader.get());
// TODO: cleanup
}

void SubMesh::SetMeshPrimitive(MeshPrimitive mesh_primitive)
@@ -77,9 +74,7 @@ void SubMesh::SetMeshPrimitive(MeshPrimitive mesh_primitive)

void SubMesh::SetShader(std::shared_ptr<Shader> shader)
{
Ticker::Unref(m_shader.get());
m_shader = shader;
Ticker::Ref(m_shader.get());
}

std::shared_ptr<Shader> SubMesh::GetShader()


Loading…
取消
儲存