mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-19 12:35:52 -04:00
Fix texture memory leak. (Thanks lavacraft)
This commit is contained in:
parent
63d71cfa2b
commit
6102a4f2ce
@ -54,6 +54,7 @@ namespace ClassicalSharp.Gui {
|
||||
Size bodySize = CalculateContentSize( e, sizes, out elementSize );
|
||||
int titleWidth = MeasureTitles( font ), titleHeight = elements[0].TitleSize.Height;
|
||||
Size size = new Size( Math.Max( bodySize.Width, titleWidth ), bodySize.Height + titleHeight );
|
||||
game.Graphics.DeleteTexture( ref texture );
|
||||
|
||||
using( Bitmap bmp = IDrawer2D.CreatePow2Bitmap( size ) )
|
||||
using( IDrawer2D drawer = game.Drawer2D )
|
||||
@ -72,7 +73,6 @@ namespace ClassicalSharp.Gui {
|
||||
public override bool HandlesMouseClick( int mouseX, int mouseY, MouseButton button ) {
|
||||
mouseX -= X; mouseY -= Y;
|
||||
if( IntersectsHeader( mouseX, mouseY ) ) {
|
||||
Dispose();
|
||||
Redraw();
|
||||
} else {
|
||||
IntersectsBody( mouseX, mouseY );
|
||||
|
@ -193,6 +193,7 @@ namespace ClassicalSharp.Gui {
|
||||
Dispose();
|
||||
api.DeleteTexture( ref caretTex );
|
||||
api.DeleteTexture( ref prefixTex );
|
||||
altText.Dispose();
|
||||
}
|
||||
|
||||
public override void MoveTo( int newX, int newY ) {
|
||||
|
@ -321,7 +321,7 @@ namespace ClassicalSharp {
|
||||
int http = value.IndexOf( "http://", index );
|
||||
int https = value.IndexOf( "https://", index );
|
||||
return http == index || https == index;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Conversion for code page 437 characters from index 0 to 31 to unicode. </summary>
|
||||
public const string ControlCharReplacements = "\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼";
|
||||
|
Loading…
x
Reference in New Issue
Block a user