Memory leak in examples

[email protected] Fri, 6 Aug 2004 14:14:45 +0200
Newsgroups gmane.comp.lang.ada.sockets
Message-ID <OF251631CE.065B30AB-ONC1256EE8.0041CD4A-C1256EE8.0043AB0A@power.com.pl>
Hello,

It turns out that dynamically allocated tasks need to be freed. The leak is
not relevant for the examples themselves, but the danger is that somebody
might use the example code as a skeleton for real code.

The affected files are listener.adb, stream_listener.adb, tcprelay.adb.
Should I provide a patch or new versions of those files? Or would you
prefer to just insert the relevant lines:


with Ada.Unchecked_Deallocation;

procedure Free is new Ada.Unchecked_Deallocation (Echo, Echo_Access);

Dummy := new Echo;
Dummy.Start (Incoming_Socket);
Free (Dummy); -- Missing free


Here is a link to c.l.a thread on this:
http://groups.google.com/groups?dq=&hl=en&lr
=&ie=UTF-8&threadm=82347202.0408051032.304d30a5%40posting.google.com&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26group%3Dcomp.lang.ada


Regards,
Wojtek Narczynski


_______________________________________________
AdaSockets mailing list
[email protected]
http://lists.rfc1149.net/mailman/listinfo/adasockets