diff --git a/Menu/GameShell/10_Settings/Bluetooth/bluetooth_page.go b/Menu/GameShell/10_Settings/Bluetooth/bluetooth_page.go index 96b5d19..8b451ea 100644 --- a/Menu/GameShell/10_Settings/Bluetooth/bluetooth_page.go +++ b/Menu/GameShell/10_Settings/Bluetooth/bluetooth_page.go @@ -471,7 +471,7 @@ func (self *BleListMessageBox) Draw() { rect2_ := rect.Rect(x,y,w,h) surface.Blit(self.CanvasHWND,my_text,&rect2_,nil) - + my_text.Free() } diff --git a/Menu/GameShell/10_Settings/Wifi/wifi.go b/Menu/GameShell/10_Settings/Wifi/wifi.go index c40fab7..60d3cc8 100644 --- a/Menu/GameShell/10_Settings/Wifi/wifi.go +++ b/Menu/GameShell/10_Settings/Wifi/wifi.go @@ -383,7 +383,7 @@ func (self *WifiListMessageBox) Draw() { rect_2 := rect.Rect(x,y,w,h) surface.Blit(self.CanvasHWND,my_text,&rect_2,nil) - + my_text.Free() } //---------WifiList--------------------------------- diff --git a/sysgo/UI/foot_bar.go b/sysgo/UI/foot_bar.go index 6c67e1b..31443a4 100644 --- a/sysgo/UI/foot_bar.go +++ b/sysgo/UI/foot_bar.go @@ -132,6 +132,11 @@ func (self *FootBar) ReadFootBarIcons( icondir string) { it.AddLabel("game", self.LabelFont) it.Adjust( self.IconWidth/2+i*self.IconWidth, self.IconHeight/2+2, self.IconWidth,self.IconHeight,0) it.IconIndex = i + if val, ok := self.Icons[v]; ok { + if val.(*FootBarIconItem).ImgSurf != nil { + val.(*FootBarIconItem).ImgSurf.Free() + } + } self.Icons[v] = it } } @@ -177,8 +182,10 @@ func (self *FootBar) UpdateNavText(texts string) { my_text := font.Render(self.LabelFont, text_, true, self.SkinManager.GiveColor("Text"),nil) final_piece = text_ if int(my_text.W) >= left_width { + my_text.Free() break } + my_text.Free() } fmt.Printf("finalpiece %s\n", final_piece) diff --git a/sysgo/UI/label.go b/sysgo/UI/label.go index c398390..e2a1823 100644 --- a/sysgo/UI/label.go +++ b/sysgo/UI/label.go @@ -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() } diff --git a/sysgo/UI/main_screen.go b/sysgo/UI/main_screen.go index 9d09c1a..4025057 100644 --- a/sysgo/UI/main_screen.go +++ b/sysgo/UI/main_screen.go @@ -118,6 +118,7 @@ func (self *MessageBox) Draw() { dest_rect := rect.Rect(x,y, word_width,word_height) surface.Blit(self.CanvasHWND, word_surface, &dest_rect,nil) + word_surface.Free() if len(words) == 1 { x+=word_width } else { diff --git a/sysgo/UI/multilabel.go b/sysgo/UI/multilabel.go index b64590d..47b12f2 100644 --- a/sysgo/UI/multilabel.go +++ b/sysgo/UI/multilabel.go @@ -126,6 +126,7 @@ func (self *MultiLabel) blit_text(surf *sdl.Surface,text string, pos_x,pos_y int } rect_ := rect.Rect(x,y,self.Width,self.Height) surface.Blit(surf,word_surface,&rect_,nil) + word_surface.Free() x += (word_width+space) } x = pos_x diff --git a/sysgo/UI/text_item.go b/sysgo/UI/text_item.go index c128380..b7a35fb 100644 --- a/sysgo/UI/text_item.go +++ b/sysgo/UI/text_item.go @@ -70,5 +70,5 @@ func (self *TextItem) Draw() { rect_ := draw.MidRect(self.PosX,self.PosY,self.Width,self.Height,Width,Height) surface.Blit(self.Parent.GetCanvasHWND(),my_text,rect_,nil) - + my_text.Free() } diff --git a/sysgo/UI/textarea.go b/sysgo/UI/textarea.go index d79e6ea..c36aee1 100644 --- a/sysgo/UI/textarea.go +++ b/sysgo/UI/textarea.go @@ -126,6 +126,7 @@ func (self *Textarea) BuildBlitText() { linenumber += 1 blit_rows = append(blit_rows,[]string{}) } + t.Free() } if len(blit_rows) == 1 { @@ -182,7 +183,7 @@ func (self *Textarea) BlitText() { rect_ := rect.Rect(x,y,0,0) surface.Blit(self.CanvasHWND,t,&rect_,nil) x += surface.GetWidth(t) - + t.Free() } } @@ -210,11 +211,13 @@ func (self *Textarea) Cursor() { break } x += surface.GetWidth(t) + t.Free() } c_t := font.Render(self.FontObj,"_",true,&color.Color{0,0,0,255},nil) rect_ := rect.Rect(x+1,y-2,0,0) surface.Blit(self.CanvasHWND,c_t,&rect_,nil) + c_t.Free() } func (self *Textarea) Draw() { diff --git a/sysgo/UI/title_bar.go b/sysgo/UI/title_bar.go index 080be2a..5a6892b 100644 --- a/sysgo/UI/title_bar.go +++ b/sysgo/UI/title_bar.go @@ -469,11 +469,13 @@ func (self *TitleBar) Draw(title string) { title_text_surf := font.Render(self.TitleFont, self.Title, true, self.SkinManager.GiveColor("Text"),nil) surface.Blit(self.CanvasHWND,title_text_surf, draw.MidRect(title_text_w/2+self.LOffset,title_text_h/2+(self.BarHeight-title_text_h)/2,title_text_w,title_text_h,Width,Height),nil) - + title_text_surf.Free() time_text_surf := font.Render(self.TimeFont, cur_time,true,self.SkinManager.GiveColor("Text"),nil) surface.Blit(self.CanvasHWND, time_text_surf, draw.MidRect(Width-time_text_w/2-self.ROffset, time_text_h/2+(self.BarHeight-time_text_h)/2, time_text_w,time_text_h,Width,Height),nil) - + + time_text_surf.Free() + start_x := Width - time_text_w - self.ROffset - self.IconWidth*3 // close to the time_text self.Icons["bluetooth"].NewCoord(start_x - self.IconWidth,self.IconHeight/2+(self.BarHeight-self.IconHeight)/2)