Skip to content

Commit

Permalink
Fix memory leak in OGL render resource manager.
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrocaster committed Feb 27, 2016
1 parent 6f94409 commit 9d13453
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Layers/xrRenderPC_GL/glResourceManager_Resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,9 @@ SPS* CResourceManager::_CreatePS (LPCSTR _name)
FS.update_path (cname, "$game_shaders$", cname);

// duplicate and zero-terminate
IReader* R = FS.r_open(cname);
IReader *file = FS.r_open(cname);
// TODO: DX10: HACK: Implement all shaders. Remove this for PS
if (!R)
if (!file)
{
string1024 tmp;
// TODO: HACK: Test failure
Expand All @@ -291,10 +291,8 @@ SPS* CResourceManager::_CreatePS (LPCSTR _name)
Msg (tmp);
strconcat (sizeof(cname), cname,GlobalEnv.Render->getShaderPath(),"stub_default",".ps");
FS.update_path (cname, "$game_shaders$", cname);
R = FS.r_open(cname);
file = FS.r_open(cname);
}

IReader* file = FS.r_open(cname);
R_ASSERT2 ( file, cname );
u32 const size = file->length();
char* const data = (LPSTR)_alloca(size + 1);
Expand Down

0 comments on commit 9d13453

Please sign in to comment.