Pārlūkot izejas kodu

Fix a crash on exit caused by shader deletion.

legacy
Sam Hocevar pirms 5 gadiem
vecāks
revīzija
00d7d2a774
2 mainītis faili ar 1 papildinājumiem un 6 dzēšanām
  1. +1
    -1
      src/lol/gpu/shader.h
  2. +0
    -5
      src/mesh/mesh.cpp

+ 1
- 1
src/lol/gpu/shader.h Parādīt failu

@@ -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 Parādīt failu

@@ -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()


Notiek ielāde…
Atcelt
Saglabāt