Drawlist image question
Drawlist image question
I'm using a drawlist image in a button gadget and it is added and removed as needed. Is a drawlist image an image that is added to the button bitmap or just instructions to draw into the buttons bitmap? Since my program can end without the drawlist image added to the button, do I need to dispose of it somehow?
AmigaOne X1000 with 2GB memory - OS4.1 FE
- thomasrapp
- Posts: 310
- Joined: Sat Jun 18, 2011 11:22 pm
Re: Drawlist image question
A button does not have a bitmap. It only calls the IM_DRAW method of the image object and the image draws itself.
An object which is not attached to any other object which automatically disposes its children has to be disposed of manually. Use IIntuition->DisposeObject for that.
An object which is not attached to any other object which automatically disposes its children has to be disposed of manually. Use IIntuition->DisposeObject for that.
Re: Drawlist image question
Pardon my misuse of "bitmap" but I still have questions about the disposal of a drawlist object. The drawlist_ic.doc doesn't list any OM_DISPOSE method, which made me wonder if it actually needs to be disposed. My drawlist image is added to any or all of 50 buttons via SetGadgetAttrs(). Since the program isn't crashing when closed with the drawlist image in multiple gadgets, I'm assuming that Intuition protects against disposing of an object multiple times and it will be safe for me to dispose of the drawlist image object after disposing of the window object.thomasrapp wrote:A button does not have a bitmap. It only calls the IM_DRAW method of the image object and the image draws itself.
An object which is not attached to any other object which automatically disposes its children has to be disposed of manually. Use IIntuition->DisposeObject for that.
AmigaOne X1000 with 2GB memory - OS4.1 FE
- broadblues
- AmigaOS Core Developer
- Posts: 600
- Joined: Sat Jun 18, 2011 2:40 am
- Location: Portsmouth, UK
- Contact:
Re: Drawlist image question
Button.gadget does not dispose of the image passeed to via BUTTON_RenderImage et al so you need to dispose of the drawlist image, other you will leak memory, albeit not very much
In terms of the autodoc not mention OM_DISPOSE, it's covered by the catch all at the end of the methods section: All other methods are passed to the superclass.
In terms of the autodoc not mention OM_DISPOSE, it's covered by the catch all at the end of the methods section: All other methods are passed to the superclass.
- broadblues
- AmigaOS Core Developer
- Posts: 600
- Joined: Sat Jun 18, 2011 2:40 am
- Location: Portsmouth, UK
- Contact:
Re: Drawlist image question
There is no protection agaist this at all, so if an object gets disposed of twice you will know about it (GR if you are lucky, more likely system lockup...)I'm assuming that Intuition protects against disposing of an object multiple times
Re: Drawlist image question
O.K. Thanks for the help.broadblues wrote:There is no protection agaist this at all, so if an object gets disposed of twice you will know about it (GR if you are lucky, more likely system lockup...)I'm assuming that Intuition protects against disposing of an object multiple times
AmigaOne X1000 with 2GB memory - OS4.1 FE