Re: [Rd] Object are not destroy while using error (Rf_error)

2023-01-23 Thread Tomas Kalibera
On 1/21/23 16:55, Antoine Lucas wrote: Dear all, I try to understand why on my computer I do not clear all data with this code: #include static int count = 0; class A { public: A(){ printf("c %d\n", count); count++; } ~A(){count--; printf("d %d\n", count); } }; extern

Re: [Rd] Object are not destroy while using error (Rf_error)

2023-01-21 Thread Dirk Eddelbuettel
Antoine, I think there are few things going on here. One is that actual _R_ objects may only get destroyed when gc() gets called. Which we applications writer do not control. Another thing that may have an effect is the use of .C() which we all more or less moved away from. Anyway, if we

[Rd] Object are not destroy while using error (Rf_error)

2023-01-21 Thread Antoine Lucas
Dear all, I try to understand why on my computer I do not clear all data with this code: #include static int count = 0; class A { public: A(){ printf("c %d\n", count); count++; } ~A(){count--; printf("d %d\n", count); } }; extern "C" { void testAL(){ A a; { A