fix memory leak by adding Free on font surface

This commit is contained in:
cuu
2019-05-06 00:01:12 +08:00
parent 8377acd017
commit d26152e14f
9 changed files with 22 additions and 7 deletions

View File

@@ -104,6 +104,7 @@ func (self *Label) DrawCenter(bold bool) { // default bold is false
rect_ := draw.MidRect(self.PosX,self.PosY,self.Width,self.Height,Width,Height)
surface.Blit(self.CanvasHWND,my_text,rect_,nil)
my_text.Free()
}
func (self *Label) Draw() {
@@ -114,5 +115,5 @@ func (self *Label) Draw() {
rect_ := rect.Rect(self.PosX,self.PosY,self.Width,self.Height)
surface.Blit(self.CanvasHWND,my_text,&rect_,nil)
my_text.Free()
}