Skip to content

Commit be8405c

Browse files
committed
ecere/gfx/3D/models/E3D: Fixed leaking Bitmap from second incref when adding to texturesByID
- TODO: Review whether code ever gets there with a 0 ref Bitmap (Debug printout added)
1 parent aff71d5 commit be8405c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ecere/src/gfx/3D/models/e3d/e3dRead.ec

+5-1
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,11 @@ static void readBlocks(E3DContext ctx, File f, DisplaySystem displaySystem, E3DB
366366
else
367367
{
368368
Bitmap bitmap = data;
369-
incref bitmap;
369+
#ifdef _DEBUG
370+
if(!bitmap._refCount)
371+
PrintLn("WARNING: E3D/textureID bitmap with 0 refs");
372+
#endif
373+
//incref bitmap;
370374
ctx.curTextureID = id;
371375
ctx.texturesByID[id] = bitmap;
372376
}

0 commit comments

Comments
 (0)