Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Simple question on delete in C++builder

Posted on 2006-07-13
5
Medium Priority
?
790 Views
Last Modified: 2013-11-17
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?
0
Comment
Question by:mikrodidakt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 11

Expert Comment

by:Jase-Coder
ID: 17097533
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
 
LVL 11

Accepted Solution

by:
Jase-Coder earned 375 total points
ID: 17097544
to turn code guard on goto project (properites or options) and then go to the codeGuard tab.
0
 

Author Comment

by:mikrodidakt
ID: 17097626
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
 
LVL 11

Expert Comment

by:Jase-Coder
ID: 17097660
what code do you have in the ~TForm1()?

what exception class does it raise?
0
 

Author Comment

by:mikrodidakt
ID: 17097764
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

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question