BBC BASIC for Windows
« AUTO cleanup »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 10:21pm



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.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: AUTO cleanup  (Read 693 times)
Michael Hutton
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 248
xx 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.

Just a thought.

Michael
« Last Edit: Jun 5th, 2009, 08:26am by Michael Hutton » User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx 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!

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls