Thanks, after some Access Violations in my code I got it to work.
But is this not better?
class Foo
{
...
private void deleteMySelf()
{
for (int i = 0; i < foo.length; i++)
{
if (foo[i] == this)
{
foo[i] = foo[$-1];
foo.length--;
delete this;
break; // is this still necessary?
}
}
}
...
}