Skip to content

Commit

Permalink
Closes #474. Added .onUnload method
Browse files Browse the repository at this point in the history
This ensures datatable.so is properly unloaded on 'detach'.
  • Loading branch information
arunsrinivasan committed Aug 3, 2014
1 parent dc448ad commit c20eba4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions R/onLoad.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,8 @@ getRversion = function(...) stop("Reminder to data.table developers: don't use g
# 3) The discipline of adding a feaure test here helps fully understand the change.
# 4) Defining getRversion with a stop() here helps prevent new switches on getRversion() being added in future. Easily circumvented but the point is to issue the message above.



.onUnload <- function(libpath) {
# fix for #474. the shared object name is different from package name
# So 'detach' doesn't find datatable.so, as it looks by default for data.table.so
library.dynam.unload("datatable", libpath)
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ We moved from R-Forge to GitHub on 9 June 2014, including history.
8. Added tests (1351.1 and 1351.2) to catch any future regressions on particular case of binary search based subset reported [here](http://stackoverflow.com/q/24729001/559784) on SO. Thanks to Scott for the post. The regression was contained to v1.9.2 AFAICT. Closes [#734](https://github.com/Rdatatable/data.table/issues/704).
9. Added a .onUnload method to unload data.table's shared object properly. Since the name of the shared object is 'datatable.so' and not 'data.table.so', 'detach' fails to unload correctly. This was the reason for the issue reported [here](http://stackoverflow.com/questions/23498804/load-detach-re-load-anomaly) on SO. Closes #474. Thanks to Matthew Plourde for reporting.

---

### Changes in v1.9.2 (on CRAN 27 Feb 2014)
Expand Down

0 comments on commit c20eba4

Please sign in to comment.