r-lib / R6

Encapsulated object-oriented programming for R
https://R6.r-lib.org
Other
405 stars 56 forks source link

Finalizers #92

Closed gaborcsardi closed 7 years ago

gaborcsardi commented 7 years ago

I know I can use reg.finalizer, in initialize or on the object, but what do you think about making finalizers more explicit, i.e. having a special finalize method?

It should not be too hard with reg.finalizer. We just check if there is a finalize method at object creation, and if there is, we call reg.finalizer on it.

wch commented 7 years ago

Sounds like a good idea to me!

gaborcsardi commented 7 years ago

OK, I'll put together a PR.