Skip to content
Prev 26654 / 63424 Next

C/C++ 'assert' should not be used in R packages

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Duncan Murdoch wrote:
I am not sure why you think we need to discard the DLL.
What if we want to access variables and routines merely to find out
the resulting state after the assert().
And it is not clear whether you mean any "subsequent calculations"
or any "subsequent calculations using code within this DLL"
might be unreliable.

But regardless of that and the assumption that users will ignore this
error, why would you want to call FreeLibrary? Since R has induced the
DLL to be loaded either directly or indirectly, R holds a handle to the
DLL. If you don't use R's cross-platform facilities for releasing the
DLL (either at the R or C-level), you will corrupt the session,
specifically in the list of assumed-live DLLs.

 D.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHNfHA9p/Jzwa2QP4RAo2BAJkB5QaFLOW5fcR6QE9JSXpIWAcEUwCggMYK
2WBnl5jDgTUayU5wk8hnQj4=
=91by
-----END PGP SIGNATURE-----