jeroen / mongolite

Fast and Simple MongoDB Client for R
https://jeroen.github.io/mongolite/
286 stars 65 forks source link

Free URI with destruction of client to avoid mem leaks #161

Open MartinNowack opened 5 years ago

jeroen commented 5 years ago

This seems a bit overkill. Can't we just free the uri after creating the client? Or can we lookup the uri object in the finalizer for the client object?

MartinNowack commented 5 years ago

@jeroen To be honest, I don't know. According to http://mongoc.org/libmongoc/current/tutorial.html, if it happens, it happens at the end. According to mongoc internals, it could be delated later.

Sure the lookup is possible, now it's just independent.