?
Solved

Access Violation when freeing a child form

Posted on 2002-07-29
15
Medium Priority
?
334 Views
Last Modified: 2010-04-04
I'm writing an MDI app. When the child forms are closed I want them to close rather than be minimised, so I've added

Action := caFree;

to the form's OnClose event. Now whenever the child form is closed I get

Project Calls.exe raised exception class EAccessViolation with message 'Access violation at address 00000000. Read of address 00000000'. Process stopped etc

If I don't add the action := cafree line the form minimises and I don't get an error.

Thanks for your help.
0
Comment
Question by:riccohb
[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
  • 6
  • 5
  • 2
  • +2
15 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7186042
too rare information,

caFree work normally properly,
there must be some other

maybe a object-reference on the form,
which is lost if you free the form

meikl ;-)
0
 
LVL 12

Expert Comment

by:Lee_Nover
ID: 7186509
yep, most probably reference to some freed pointer (object)
0
 
LVL 4

Expert Comment

by:jsweby
ID: 7186523
Is "Action := caFree" the last line in your FormClose event?

J.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:riccohb
ID: 7187384
I've just added a blank form to the project with just Action := caFree in the form's OnClose event and the problem still happened.

jsweby - yes, it is the last line. Usually it's the only line in that procedure.
0
 
LVL 4

Expert Comment

by:jsweby
ID: 7187389
Can you show us how you are creating the form - the whole procedure where you decide you want to show the form.

J.
0
 
LVL 6

Accepted Solution

by:
swift99 earned 400 total points
ID: 7189063
It sounds like your master form is looking at an object on the form you're freeing.  Or you may have a recursive reference.
0
 

Author Comment

by:riccohb
ID: 7190145
The master form was, as you say, referencing the form immediately after it closed.

I'll also give points to jsweby in a 'points for jsweby' question.

Thanks folks.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7190153
and me?

at least i suggested
>maybe a object-reference on the form,
>which is lost if you free the form
first

meikl ;-)

0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7190154
maybe i was ignored :-(
0
 

Author Comment

by:riccohb
ID: 7190185
Sorry Kretzschmar. I inadvertently overlooked you. An honest mistake! I've just awarded my last 40 points to jsweby but I'm about to go on an answering spree to earn more points, and when I do I'll ask a 'points for kretzschmar' question.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7193144
well, ok ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7202799
some days ago . . .
0
 

Author Comment

by:riccohb
ID: 7202818
Patience...
0
 

Author Comment

by:riccohb
ID: 7216422
Kretzchmar - I've now posted your 'points for Kretzschmar' question.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7216430
thanks
yippi :-))
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month9 days, 3 hours left to enroll

764 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