Welcome Guest. Please Login or Register. Apr 5th, 2018, 11:14pm
ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018. Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.
If you require a dump of the post on your message board, please come to the support board and request it.
AUTO cleanup
« Thread started on: Jun 5th, 2009, 08:25am »
I shouldn't really post this as I haven't done any reading on this subject at all but I was wondering if anyone had any ideas or had got anywhere towards creating a automatic cleanup routine, or indeed if this could be done at all?
I think it would be a very useful library routine that could detect handles to dialog boxes, GDI objects etc (can this be done?), or libraries or any other such objects which the user has created and automatically delete them.
This would be a great asset to the language, and the user wouldn't have to create a custom cleanup routine everytime a windows object is created.
Re: AUTO cleanup
« Reply #1 on: Jun 5th, 2009, 09:01am »
Quote:
This would be a great asset to the language, and the user wouldn't have to create a custom cleanup routine everytime a windows object is created.
Bear in mind that Windows is pretty good at cleaning up after itself when a process is terminated. So, although it's good practice to do so, you often don't need to worry too much about deleting objects on exit once your program is 'compiled'.
The issue arises when you are developing the program in the IDE, in which case no 'automatic cleanup' takes place until you actually quit BB4W completely. However, even then you may get away with it if you're not running the program very many times (this applies mainly to simple objects; it may be more important to clean up COM objects etc.).
A more serious issue is avoiding resource leaks while your program is running. No 'automatic' cleanup will ever help you there.
Quote:
indeed if this could be done at all?
This is plainly not a BB4W-specific issue, but affects all languages. Have you seen an 'automatic cleanup' routine in any programs written in a different language (e.g. C)? If not, you should perhaps ask yourself if that is significant!