namespace psm_cfunc {
public class Test_Entity {
public List<Entity> Ents; // Список отрезков
// Создание набора отрезков
public void test_create_lines() {
Ents = new List<Entity>();
int NE = 100000;
for (int i = 0; i < NE; i++)
this.Ents.Add(new Line(new Point3d(0, 0, 0),
new Point3d(1, 1, 0)));
}
~Test_Entity() {
for (int i = 0; i < Ents.Count(); i++) // наверное этот цикл вообще лишний???
this.Ents[i] = null;
this.Ents.Clear();
this.Ents = null;
}
}
// Два тестовых метода для создания и уничтожения объектов.
public class c_psm_functions {
// объект класса объявлен глобально.
public static Test_Entity TE = new Test_Entity();
public static void Createlines()
{
TE.test_create_lines();
}
public static void Freelines()
{
TE = null;
// Вызов сборщика мусора
GC.WaitForPendingFinalizers();
GC.Collect();
}
} // End class c_psm_functions
} // End namespace