Skip to content

Commit

Permalink
ecere/gfx/3D/models/E3D: Fixed leaking Bitmap from second incref when…
Browse files Browse the repository at this point in the history
… adding to texturesByID

- TODO: Review whether code ever gets there with a 0 ref Bitmap (Debug printout added)
  • Loading branch information
jerstlouis committed Jul 13, 2020
1 parent aff71d5 commit be8405c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ecere/src/gfx/3D/models/e3d/e3dRead.ec
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,11 @@ static void readBlocks(E3DContext ctx, File f, DisplaySystem displaySystem, E3DB
else
{
Bitmap bitmap = data;
incref bitmap;
#ifdef _DEBUG
if(!bitmap._refCount)
PrintLn("WARNING: E3D/textureID bitmap with 0 refs");
#endif
//incref bitmap;
ctx.curTextureID = id;
ctx.texturesByID[id] = bitmap;
}
Expand Down

0 comments on commit be8405c

Please sign in to comment.