Autor Beitrag
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: So 09.03.03 22:34 
wie muss ich serversocket bei beendigung des progs freigeben?

serversocket1.free;
serversocket1.close;
serversocket1.active := false;


:?: :?: :?: :? :?: :?: :?:
DeCodeGuru
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1333
Erhaltene Danke: 1

Arch Linux
Eclipse
BeitragVerfasst: So 09.03.03 22:40 
versuchs mal so:

ausblenden Quelltext
1:
2:
3:
4:
5:
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  serversocket1.close;
  serversocket1.free;
end;


Free gibt ein Objekt frei. Danach kannste nicht mehr auf das Objekt zugreifen -> nichts ist mit close.

Achja, serversocket1.close setzt Active auf False;

_________________
Viele Grüße
Jakob
torstenheinze Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: So 09.03.03 22:42 
ok, danke


ich hab ja nur einige varianten hingeschrieben, nicht in der richtigen reinfolge, das waren ja nur die wo ich dachte das sie sowas in der richtung bewirken könnten
torstenheinze Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: So 09.03.03 22:43 
kann ich das auch bei form1.destroy reinschreiben?
DeCodeGuru
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1333
Erhaltene Danke: 1

Arch Linux
Eclipse
BeitragVerfasst: So 09.03.03 22:44 
Kannste auch machen. Such einfach mal in der Hilfe nach den Ereignissen. Dann weisst du, wann die Ereignisse auftreten.

_________________
Viele Grüße
Jakob
torstenheinze Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: So 09.03.03 22:46 
ich weiß wann destroy auftritt, doch es hätte ja sein können, das wenn ich es da mache irgendwelche komplicationen kommen, man weiß ja nie... :wink:
DeCodeGuru
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1333
Erhaltene Danke: 1

Arch Linux
Eclipse
BeitragVerfasst: So 09.03.03 22:47 
probier es aus. :wink:

_________________
Viele Grüße
Jakob
torstenheinze Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: So 09.03.03 22:50 
jup
DaRkFiRe
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 526

WinXP Home & Professional
C, C++, Delphi
BeitragVerfasst: So 09.03.03 23:59 
Die Freigabe erfolgt nach einer Hierarchie. Demnach werden alle Unterobjekte AUTOMATISCH freigegeben, bevor das Elternelement schließlich freigegeben wird... Demnach sollte ein Aufruf von Free überflüssig sein. Allerdings dient es dem Aussehen des Source-Codes.

ServerSocket schließen - aber Freigeben der Komponente übernimmt die Form, denn wer gibt schon alle Komponenten der Form Buttons, Labels, Edits usw. von Hand frei!?

_________________
Lang ist der Weg durch Lehren - kurz und wirksam durch Beispiele! Seneca