This might still not be correct... you imght now not have an AV, but you 
might have a memory leak...

At the risk of sounding like a broken record (seeing as I've given this same 
advice not too long ago...), I'd recommend you do yourself a favour and run 
the application with the MemCheck memory management unit replacement.  It 
will help you confirm whether you're properly managing your memory/freeing 
stuff when you should free them.  Post back if you have trouble and we'll 
see whether we can help further.  (MemCheck: 
http://v.mahon.free.fr/pro/freeware/memcheck/ )

I might add that often AV's in components (indeed, in general) are often due 
to dangling object pointers pointing to objects that have been freed... This 
situation is more easily spotted if you make a point of always nilling 
references to a given object when you free it. No exceptions, no but's. 
Then you'll clearly see when code tries to dereference a nil pointer etc. 
There's also a whole notification system that you need to be aware of/take 
note of when your component holds references to other components, to ensure 
you properly react (by nilling your held references) when these components 
notify you that they're being destroyed.  Otherwise, your component might 
accidentally try to access a held reference when the component has already 
been destroyed by the VCL (for example when a form is being destroyed.) 
But, I assume you're already aware of this?

HTH

Walter

----- Original Message ----- 
From: "logman0u812" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, June 17, 2005 6:29 PM
Subject: [list] Re: [delphi-en] Component creation and TStrings


> Well, that did the trick :)
> I removed all tstring free'ing from my destructor and
> I no longer have an AV exeception
>
> thanks to all for the help.
> Frank
>
>
> <[EMAIL PROTECTED]> wrote:
>
>>you HAVE to free your tStrings or tStringLists!
>>Only components which have in their Create-Method
>>an AOwner-Parameter will be freed by the owner.
>>
>> Have fun
>> Bob



-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to