Skip to content

Commit

Permalink
Added gdaldestroy at exit and commented `cplseterrorhandler(C_NULL)…
Browse files Browse the repository at this point in the history
…` and trial wih `gdaldumpopendatasets` at exit
  • Loading branch information
mathieu17g committed Oct 3, 2021
1 parent 10815fd commit c8939bd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gen/epilogue.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ const GDAL_DATA = Ref{String}()
const PROJ_LIB = Ref{String}()

function __init__()
# Cleanup at exit
atexit(gdaldestroy)
# atexit(() -> gdaldumpopendatasets("/dev/stderr")) # TODO find a way to pass a pointer to stderr

# register custom error handler
funcptr = @cfunction(gdaljl_errorhandler, Ptr{Cvoid}, (CPLErr, Cint, Cstring))
cplseterrorhandler(funcptr)
atexit(() -> cplseterrorhandler(C_NULL))
# atexit(() -> cplseterrorhandler(C_NULL))

# get GDAL version number
versionstring = gdalversioninfo("RELEASE_NAME")
Expand Down

0 comments on commit c8939bd

Please sign in to comment.