Is FreeBrush() necessary to call before LoadBrush()
Posted: Sat Aug 28, 2021 7:50 pm
Hi there
In my RapaGUI app I'm having an <image> widget that will always display my brush #1. So I'm loading an image into brush #1 and later overwriting it with another image. Now I'm concerned about memory consumption and garbage collection: is it advisable to always call FreeBrush() first before loading the new brush #1?
Example:
Would it be better to do it like this or maybe it doesn't matter because LoadBrush() might already handle this?
Cheers, Michael
In my RapaGUI app I'm having an <image> widget that will always display my brush #1. So I'm loading an image into brush #1 and later overwriting it with another image. Now I'm concerned about memory consumption and garbage collection: is it advisable to always call FreeBrush() first before loading the new brush #1?
Example:
Code: Select all
@BRUSH 1, "images/empty.png"
(...)
LoadBrush(1, "images/brush1.png")
(...)
LoadBrush(1, "images/brush2.png")
(...)
LoadBrush(1, "images/brush3.png")
(...)
Code: Select all
@BRUSH 1, "images/empty.png"
(...)
FreeBrush(1)
LoadBrush(1, "images/brush1.png")
(...)
FreeBrush(1)
LoadBrush(1, "images/brush2.png")
(...)
FreeBrush(1)
LoadBrush(1, "images/brush3.png")
(...)