thanks for the help:
I created a little example program
Code:
program listexample;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes, Contnrs ,crt
{ you can add units after this };
type
obby=class(Tobject)
name:string;
end;
var
o:obby;
obby_list:Tobjectlist;
iter1:integer;
iter2:integer;
{$IFDEF WINDOWS}{$R listexample.rc}{$ENDIF}
begin
obby_list:=Tobjectlist.create(true);
REPEAT
for iter1:=0 to 10 do
begin
for iter2:=0 to 10 do
begin
obby_list.add(obby.create);
end;
obby_list.clear();
end;
UNTIL keypressed;
end.
sorry for any lack of formatting
I went into windows taskmanager and the program stayed the same size so no memory leaks so far
I tried learning C++ and it was very difficult,
I was using a vector and my program had a memory leak which I couldnt get rid of.
looks like it will be a lot easier to create DS games with pascal.
Bookmarks