Fixed some memory leaks from Bitmaps
This commit is contained in:
1 parent
9c3f1d9ebd
commit
c95214ba06
3 files changed
+8
-1
No files matched your search
@@ -1187,6 +1187,8 @@ namespace Vocaluxe.Base
|
||||
Graphics g = Graphics.FromImage(bmp);
|
||||
g.DrawImage(origin, new Rectangle(0, 0, w, h));
|
||||
g.Dispose();
|
||||
if (origin != null)
|
||||
origin.Dispose();
|
||||
|
||||
byte[] data = new byte[w * h * 4];
|
||||
|
||||
@@ -1484,6 +1486,8 @@ namespace Vocaluxe.Base
|
||||
Graphics g = Graphics.FromImage(bmp);
|
||||
g.DrawImage(origin, new Rectangle(0, 0, w, h));
|
||||
g.Dispose();
|
||||
if (origin != null)
|
||||
origin.Dispose();
|
||||
tex = CDraw.AddTexture(bmp);
|
||||
byte[] data = new byte[w * h * 4];
|
||||
|
||||
|
||||
@@ -178,6 +178,7 @@ namespace Vocaluxe.Base
|
||||
Bitmap bmp = new Bitmap(origin, w, h);
|
||||
STexture tex = _Draw.AddTexture(bmp);
|
||||
bmp.Dispose();
|
||||
origin.Dispose();
|
||||
return tex;
|
||||
}
|
||||
|
||||
|
||||
@@ -881,7 +881,9 @@ namespace Vocaluxe.Lib.Draw
|
||||
CLog.LogError("Error loading Texture: " + TexturePath);
|
||||
return new STexture(-1);
|
||||
}
|
||||
return AddTexture(bmp, TexturePath);
|
||||
STexture s = AddTexture(bmp, TexturePath);
|
||||
bmp.Dispose();
|
||||
return s;
|
||||
}
|
||||
CLog.LogError("Can't find File: " + TexturePath);
|
||||
return new STexture(-1);
|
||||
|
||||
Reference in new issue
Block a user