[Texture Disposal] This should be okay??

This commit is contained in:
Aragas 2016-09-22 21:00:45 +03:00
parent 87840100b1
commit ba2e052830
13 changed files with 123 additions and 0 deletions

View File

@ -97,4 +97,9 @@
End If
End Sub
Protected Overrides Sub Finalize()
If CanvasTexture1 IsNot Nothing
CanvasTexture1.Dispose()
End If
End Sub
End Class

View File

@ -522,4 +522,9 @@
Return startTime + duration < Date.Now
End Function
Protected Overrides Sub Finalize()
If blurTexture IsNot Nothing
blurTexture.Dispose()
End If
End Sub
End Class

View File

@ -252,6 +252,12 @@
Core.SpriteBatch.Draw(Me.Texture, r, Color.White)
End Sub
Protected Overrides Sub Finalize()
If Texture IsNot Nothing
Texture.Dispose()
End If
End Sub
End Structure
Shared gradientConfigs As New List(Of GradientConfiguration)
@ -282,4 +288,9 @@
Core.SpriteBatch.Draw(Canvas, startPoint, Nothing, Color, CSng(angle), Vector2.Zero, New Vector2(CSng(length), CSng(width)), SpriteEffects.None, 0)
End Sub
Protected Overrides Sub Finalize()
If Canvas IsNot Nothing
Canvas.Dispose()
End If
End Sub
End Class

View File

@ -73,4 +73,12 @@
Core.SpriteBatch.DrawString(FontManager.MainFont, Localization.GetString("donation_screen_backadvice"), New Vector2(CInt(Core.windowSize.Width / 2) - FontManager.MainFont.MeasureString("Press E to close").X / 2, 640), Color.White)
End Sub
Protected Overrides Sub Finalize()
If texture1 IsNot Nothing
texture1.Dispose()
End If
If texture2 IsNot Nothing
texture2.Dispose()
End If
End Sub
End Class

View File

@ -358,4 +358,21 @@
Me.moveLearnArg = arg
End Sub
Protected Overrides Sub Finalize()
If BorderTexture1 IsNot Nothing
BorderTexture1.Dispose()
End If
If BorderTexture2 IsNot Nothing
BorderTexture2.Dispose()
End If
If BorderTexture3 IsNot Nothing
BorderTexture3.Dispose()
End If
If BorderTexture4 IsNot Nothing
BorderTexture4.Dispose()
End If
If BorderTexture5 IsNot Nothing
BorderTexture5.Dispose()
End If
End Sub
End Class

View File

@ -326,4 +326,18 @@
ChangeBag()
End Sub
Protected Overrides Sub Finalize()
If texture1 IsNot Nothing
texture1.Dispose()
End If
If texture2 IsNot Nothing
texture2.Dispose()
End If
If texture3 IsNot Nothing
texture3.Dispose()
End If
If texture4 IsNot Nothing
texture4.Dispose()
End If
End Sub
End Class

View File

@ -198,4 +198,12 @@
MenuItems.Add(Localization.GetString("item_detail_screen_back"))
End Sub
Protected Overrides Sub Finalize()
If CanvasTexture1 IsNot Nothing
CanvasTexture1.Dispose()
End If
If CanvasTexture2 IsNot Nothing
CanvasTexture2.Dispose()
End If
End Sub
End Class

View File

@ -279,4 +279,12 @@
MusicManager.ForceVolumeUpdate()
End Sub
Protected Overrides Sub Finalize()
If CanvasTexture1 IsNot Nothing
CanvasTexture1.Dispose()
End If
If CanvasTexture2 IsNot Nothing
CanvasTexture2.Dispose()
End If
End Sub
End Class

View File

@ -553,4 +553,12 @@
Return Localization.GetString("new_game_oak_name_1") & name & Localization.GetString("new_game_oak_name_2")
End Function
Protected Overrides Sub Finalize()
If texture1 IsNot Nothing
texture1.Dispose()
End If
If texture2 IsNot Nothing
texture2.Dispose()
End If
End Sub
End Class

View File

@ -541,6 +541,14 @@
End If
End Sub
Protected Overrides Sub Finalize()
If texture1 IsNot Nothing
texture1.Dispose()
End If
If texture2 IsNot Nothing
texture2.Dispose()
End If
End Sub
End Class
Class CommandButton
@ -622,6 +630,14 @@
End If
End Sub
Protected Overrides Sub Finalize()
If texture1 IsNot Nothing
texture1.Dispose()
End If
If texture2 IsNot Nothing
texture2.Dispose()
End If
End Sub
End Class
Class ScrollBar
@ -803,4 +819,9 @@
#End Region
Protected Overrides Sub Finalize()
If texture1 IsNot Nothing
texture1.Dispose()
End If
End Sub
End Class

View File

@ -216,4 +216,9 @@
End If
End Sub
Protected Overrides Sub Finalize()
If texture1 IsNot Nothing
texture1.Dispose()
End If
End Sub
End Class

View File

@ -127,4 +127,9 @@
End If
End Sub
Protected Overrides Sub Finalize()
If CanvasTexture1 IsNot Nothing
CanvasTexture1.Dispose()
End If
End Sub
End Class

View File

@ -195,4 +195,12 @@
End If
End Sub
Protected Overrides Sub Finalize()
If CanvasTexture1 IsNot Nothing
CanvasTexture1.Dispose()
End If
If charTexture IsNot Nothing
charTexture.Dispose()
End If
End Sub
End Class