A memory leak simple example (BlackBox 1.6).
DevLinker.LinkExe MemoryLeak.exe := Kernel+ Files HostFiles Dialog Math Strings Stores TestExe
MODULE TestExe;
IMPORT Files, Stores, WinApi;
PROCEDURE Do;
VAR file: Files.File;
wr: Stores.Writer;
res: INTEGER;
BEGIN
file := Files.dir.New(Files.dir.This(""), FALSE);
wr.ConnectTo(file);
wr.WriteString ("Hello World!");
file.Register("tmp", "txt", FALSE, res)
END Do;
BEGIN
LOOP
Do;
WinApi.Sleep(50)
END
END TestExe.
Run the MemoryLeak.exe programm and watch to Windows Task Manager about 10 - 20 minutes later...
Received on Thu May 10 2007 - 19:29:10 UTC