when I try to build that code with
-runtime error,Code:void dyn_obj::function(int & value) { value++; if(del_now)delete this; else del_now = true; }
and
-works, but looking at the task manager: it doesn't deallocate the memory(objects to create set to 1 000 000, after the second callCode:void dyn_obj::function(int & value) { value++; if(del_now)this -> ~dyn_obj(); else del_now = true; }
the list is not linked, but the memory consumption is the same)