Results 1 to 10 of 14

Thread: delete object on a list

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    delete object on a list

    if i want to remove an object from a list and free it from memory do i do this?
    Code:
    myobj=obby.create;
    mylist.add(myobj);
    
    for i:=0 to mylist.count-1 do
    begin
    if mylist[i].name='trev'
    begin
    mylist.delete(i); //removes object from list
    mylist[i].free;//frees from memory
    exit;
    end;
    end;
    also, is there a command to remove all objects from a list AND free their memory?
    Last edited by slenkar; 23-11-2010 at 08:56 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •