Hello Markus,

Release post a message to a hidden window. when the message is received
Destroy is called. You can check that with the debugger.

Destroy call the destructor direct. Free checks for null value and then
calls Destroy.

---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
http://www.mestdagh.biz

Wednesday, February 18, 2009, 09:47, Markus Mueller wrote:

> This also don't work. I never see my (extended) destructor beeing called,
> if it is called "Free" nor "Destroy". Also my memory usage is increasing
> if I just do "release". If I do Free I get memory errors but the memory
> usage is not increasing.

> Please, how is the realy right way to free the TWSocket objects ? It seems
> that Release doesn't do anything...

> Much regards,
> Markus Müller
>> Destructor must be called "Destroy", not "Free"
>>
>> Markus Mueller wrote:
>>   
>>> Hi Wilfried,
>>>
>>> I have created an destructor Free, which inherited runs Free of 
>>> TWSocket. This
>>> Free is never called; can anybody tell me why?
>>>
>>> Are you realy sure it is freed by calling Release if it is never calling
>>> Free?!
>>>
>>> Regards,
>>> Markus Mueller
>>>   
>>>     
>>>> Hello Markus,
>>>>
>>>> you have to destroy it outside an event handler. to do that you can call
>>>> the Release method. Then it is destroyed when messages are pumped again,
>>>> so after your code finish.
>>>>
>>>> ---
>>>> Rgds, Wilfried [TeamICS]
>>>> http://www.overbyte.be/eng/overbyte/teamics.html
>>>> http://www.mestdagh.biz
>>>>
>>>> Tuesday, February 17, 2009, 10:40, Markus Müller wrote:
>>>>
>>>>   
>>>>     
>>>>       
>>>>> Hello Mailinglist,
>>>>>     
>>>>>       
>>>>>         
>>>>   
>>>>     
>>>>       
>>>>> my project is now just working great, thanks very much for your
>>>>> help... but there is just one question. Cause it only works fine
>>>>> if I don't free TWSocket objects. If I Free them it often works
>>>>> fine. But in much cases - for example - in the OnSessionClose
>>>>> Handler (the memory of the handler is provided by an other Object
>>>>> not beeing freed) then I get strange behaviors. Sometimes it gives
>>>>> memory errors on "InternalClose" functions, sometimes the application
>>>>> just freezes completely (strange cause all TWSocket is in an own
>>>>> thread) and Delphi crashes the hard way...
>>>>>     
>>>>>       
>>>>>         
>>>>   
>>>>     
>>>>       
>>>>> If I do "Abort" on an TWSocket, then the following lines are not
>>>>> running... It seems that it calls "exit" withing the function? So my
>>>>> "Free" is never reached. In this case I have completly no idear
>>>>> how to Free such a socket....
>>>>>     
>>>>>       
>>>>>         
>>>>   
>>>>     
>>>>       
>>>>> So my question is: How can I free a TWSocket object after the
>>>>> connection has been closed, aborted or the handler reports that
>>>>> the session has been closed.
>>>>>     
>>>>>       
>>>>>         
>>>>   
>>>>     
>>>>       
>>>>> Thanks for hints,
>>>>> Much regards,
>>>>> Markus Mueller
>>>>>     
>>>>>       
>>>>>         
>>>>   
>>>>     
>>>>       
>>>   
>>>     
>>
>>   


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to