Simple question on delete in C++builder

Hi!

When i am done with a form should i den take care of all the components in that form by using the delete on every component or is that done aotumatic when the form is destroyed?
mikrodidaktAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Jase-CoderConnect With a Mentor Commented:
to turn code guard on goto project (properites or options) and then go to the codeGuard tab.
0
 
Jase-CoderCommented:
when you drag components to the form the memory deallocation is taken care of. You only need to use the delete when you have used the new.

If your worried about memory leaks switch codeguard on and this will inform you of any memory leaks in your application.
0
 
mikrodidaktAuthor Commented:
Thanks Jase-Coder the reason  i asked is that i get a exception that i did not know how to solve the strange thing is that when i but the code gard on i dont get the exception but if put it of there it is again.
You have already disurved your points but if know any thing about this i would appreciate your help.
The exception i get is

Project xxxx raised exception class yyyyy with message 'zzzzzz'.
Process stopped.  Use Step or Run to continue.

I get this exception if i dont use any breakpoints and this one if i am using breakpoints

Project projectname raised too many consecutive exceptions: application defined exception (code xxxx) at xxxx. Process stopped. Use Step or Run to continue.

I get these in the ~TForm when i close my form.
0
 
Jase-CoderCommented:
what code do you have in the ~TForm1()?

what exception class does it raise?
0
 
mikrodidaktAuthor Commented:
In the Form.hpp file
#pragma option push -w-inl
/* TCustomForm.Destroy */ inline __fastcall virtual ~TForm(void) { }
#pragma option pop

The exception class is Access violation

The Code gaurd dose't give me no warnigs or anything elese so by that i assume i have no leaks

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.