Skip to content
Prev 26807 / 29559 Next

Possibly breaking changes in rgeos

In this sf issue (https://github.com/r-spatial/sf/issues/822), it was 
pointed out that error handling in rgeos (and sf) leaked memory at least 
when invalid geometries triggered an exception, leading to an R error, but 
without the GEOS objects being freed/destroyed. An attempt has been made 
to address this problem in rgeos, and is available for testing from 
R-Forge (version 0.4-1):

install.packages("rgeos", repos="http://R-Forge.R-project.org")

Please check whether this version (throwing the R error after freeing 
memory in calling function rather than throwing the R error immediately on 
exception) has missed any important points in your typical workflows - if 
you find any, please write directly to me as maintainer with a small 
reproducible example for adding to tests/leak_by_exception.R. If you find 
anything, also consider using gdb and/or valgrind to backtrack to the 
rgeos C function causing the mayhem.

Grateful for any reports,

Roger
(rgeos maintainer)