Hi Jeremy,
        I created it like so:

DataModule1 := TDataModule.Create(Self);

in the mainform's OnCreate event method.  And I've made sure it's not
created by the application in the dpr.  Indeed you are correct in that Free
or FreeAndNil should work by itself correctly, however I tried them both
after testing of it to ensure it isn't already nil, and within the
mainform's OnClose method, but doing so gives me the pointer error on my
first call to MainForm Close, finally shuitting down correctly after I call
it a second time!
        If however, I use the DataModuleDestroy(Self); method followed by
FreeAndNil, the Application closes without problem!  And believe me, I've
checked and re-checked for anything that might not be getting freed
correctly or that nothing I'm trying to free was already freed earlier.  So
I don't have a clue as to why this is happening...thus like all good
programmers I'll blame it on Vista! <g>  

from Robert Meek dba "Tangentals Design"
e-mail: [EMAIL PROTECTED]
Freelance Windows Programming for XP and Vista 
Also proud to be a Moderator of the "Delphi-List" at elists.org

"Reality cannot be explained...only enjoyed or endured as your current
perspective allows!"

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Jeremy North
Sent: Friday, September 28, 2007 9:13 PM
To: Borland's Delphi Discussion List
Subject: Re: CodeGear D7 patched to ver 3

Hi Robert,

There is something wrong with your implementation. You shouldn't have
to call the OnDestroy event like you are. It should get called
automatically when you call Free. Who is the owner of the Datamodule,
perhaps it is being automatically freed.

cheers,
Jeremy
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to