Solved

GPF on closing application.

Posted on 1997-06-16
3
199 Views
Last Modified: 2010-04-04
Hi,

I have a D1 app that gives a GPF on closing, but only if there are no children open in the main form.  If there is a child open, it closes no problem.  If I step through the
code, it goes all the way through the FormDestroy event handler, and on exit from there goes to the FormResize event handler.  If I F7 past the END ; of that event handler,
I get the GPF.  The FormDestroy handler writes the INI file, and has a few FREEs. Whatever, disabling the code in these event handlers does not alter the behaviour.

The other curious thing is that it only occurs on 1 of many machines we have.  There is nothing peculiar about this machine.

 
0
Comment
Question by:rossmcm
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
icampbe1 earned 100 total points
ID: 1337088
Your problem is almost always an attempt to free an object that doens't exist.  Make sure that you follow each of the frees with a NIL assignment:  Obj.Free;  Obj := NIL;   Subsequent frees will be OK with this.

Also, I'm not sure I understand the sequence of your comment above.  You destroy the form and then resize it???

Anyhow, do the NIL assignments first.  It is a good practice to follow.  If it still doesn't work, we'll look more closely.

Ian C.

0
 

Author Comment

by:rossmcm
ID: 1337089
Tried assignments to NIL after the frees - no change.  

I don't actually destroy the form and then resize it.  
What I think is happening is that the OnResize event
for the main form is being called 'automatically'
because the form has been destroyed.   Removing the
OnResize handler has no effect.

0
 
LVL 2

Expert Comment

by:icampbe1
ID: 1337090
Thanks for the grade..  Is it fixed?  If not, whats different about the machine that it happens on (how is it different from the ones it works on)?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

948 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now