File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,8 @@ void finalizer_wrapper(SEXP p) {
3737 T* ptr = (T*) R_ExternalPtrAddr (p);
3838 RCPP_DEBUG_3 (" finalizer_wrapper<%s>(SEXP p = <%p>). ptr = %p" , DEMANGLE (T), p, ptr)
3939
40- // Clear before finalizing to avoid interesting behavior,
40+ // Clear before finalizing to avoid interesting behavior
41+ // like access of freed memory,
4142 // e.g. https://github.com/r-dbi/RPostgres/issues/167
4243 R_ClearExternalPtr (p);
4344
@@ -181,6 +182,7 @@ class XPtr :
181182 // default C++ finalizer is since delete NULL is a no-op).
182183 // This clears the external pointer just before calling the finalizer,
183184 // to avoid interesting behavior with co-dependent finalizers,
185+ // like access of freed memory,
184186 // e.g. https://github.com/r-dbi/RPostgres/issues/167.
185187 finalizer_wrapper<T,Finalizer>(Storage::get__ ());
186188 }
You can’t perform that action at this time.
0 commit comments