similar to: Using .onUnload to unload DLLs

Displaying 20 results from an estimated 3000 matches similar to: "Using .onUnload to unload DLLs"

2006 Feb 08
2
Using .onUnload() to unload compiled code
If one wants to unload compiled code for a package containing a namespace, my understanding is that .onUnload() should be used, with a call to library.dynam.unload(). This is used in e.g., the stats and methods packages, but it appears to me that the compiled code is not being unloaded when the package is detached(). Am I misunderstanding something? Best, Jim > search() [1]
2010 Sep 16
1
Possible bug or annoyance with library.dynam.unload()
Hello, I have a package with a namespace. Because I use Roxygen that overwrites the NAMESPACE file each time it is run, I use a R/zzz.R file with an .onLoad() and .onUnload() functions to take care of loading and unloading my shared library. The problem: if I load my library from a local directory, then the unloading of the package fails, e.g: # loads fine >library(Foo,
2016 Mar 25
1
library.dynam.unload
The survival package has a firstlib.R file that I had forgotton and just reviewed. After deleting several bits which had a use 10 years ago during my Splus to R transition, the only thing remaining is .onUnload <- function(libpath) library.dynam.unload("survival", libpath) Does this bit of code still serve a purpose? Can I toss it? Terry T.
2010 Nov 12
1
unloading compiled code.
I have a package that I'm developing that I need to unload the library. Long story short I figured out that the leaving the compiled code loaded lead to a segmentation fault, but unloading the code will fix it. I've read the documentation and it appears that there are several ways to do this? What is the popper accepted current standard for unloading compiled code? The options as I
2014 Nov 11
0
Should R Packages Unload Dynamic Libraries When They Unload?
>From Hadley's C best practices (http://r-pkgs.had.co.nz/src.html#c-best-practices): > Like with C++, whenever you use C code in your package, you should unload the DLL when the package is unloaded: .onUnload <- function (libpath) { library.dynam.unload("mypackage", libpath) } Writing R Extensions on the other hand doesn't even mention this (AFAIK). I
2008 Apr 24
4
Scriptaculous Help (page exit effects)
I was wondering if it was possible in Prototype/Scriptaculous to run an effect when a link is clicked, then go to that page, or if it was possible to have an effect run when the page unloads. I have tried <body onunload="new Effect.Fade("whatever");> and some prototype page exit events, could get a alert("") function to work, but not the effects. Any ideas?
2009 Mar 31
4
what is the preferred method to create a package local variable?
for the moment, I'm using: .onAttach <- function(libname, pkgname) { .bbg.db.conn <<- dbConnect(dbDriver("PostgreSQL"), user="blah","blah") } .onUnload <- function(libpath) { dbDisconnect(.bbg.db.conn) } which results in a hidden global variable in the global environment. I would prefer to make the assignment only in the package namespace.
2005 Nov 11
0
(kind of OT) Equivalent to onunload or onbeforeunload in Safari?
I realize this isn''t specifically a Rails question, but I figure others here will have encountered it. I have a client that wants form data to be saved when leaving a page. This could include leaving a page by following a link, closing a window, or pressing the back or forwards buttons. So ... I do some research, and found this Web page:
2012 Jul 24
1
Finding dynamic shared libraries loaded with a package
Is there a way to query a package to see what dynamic shared libraries are loaded with it? The reason I ask is because during development, I want to unload libraries so that they can be reloaded without restarting R. I want to make it automatic so that you can just pass in the name of the package, and it will unload all the relevant shared libraries. Typically, the name of the shared library is
2007 Jan 16
2
on.exit called on loading ?
I just found out that an .onLoad() function such as this stylized one (where I just renamed some identifiers) .onLoad <- function(lib, pkg) { require(zoo, quiet=TRUE, warn.conflicts=FALSE) library.dynam("foolib", pkg, lib ) if (.Platform$OS.type != "windows") { initSomeServices() } if (.Platform$OS.type != "windows") {
2005 Jun 28
1
Thomas script.aculo.us (important bug and add ons)
Sorry. Posted from wrong email originally. Moderator, please ignore other post. Thx. To Thomas Fuchs, First of all, thanks for your amazing scripts on script.aculo.us. You''ve got quite some talent. I knew I was in for a treat when I read your goals (mainly about simplicity). My goals exactly. Keep it simple is great when you''re trying to integrate 100 different things. I wrote
2013 Dec 19
2
Strange warnings when unloading packages with S4 classes
I've been seeing warnings when unloading packages. They can be seen with the shiny and sp packages, among others (this is on R 3.0.2). For example: > library(sp) > unloadNamespace('sp') Warning messages: 1: In FUN(X[[2L]], ...) : Created a package name, ‘2013-12-19 12:14:24’, when none found 2: In FUN(X[[2L]], ...) : Created a package name, ‘2013-12-19 12:14:24’, when none
2014 Oct 29
2
Unexpected behavior of identical() with language objects
I ran into this and found the result very surprising: identical( quote({ a }), quote({ a }) ) # FALSE It seems related to curly braces. For example, parens work fine: identical( quote(( a )), quote(( a )) ) # TRUE Is this expected behavior? I can't seem to find anything in the help for identical that relates to this. -Winston
2017 Apr 18
2
system/system2 and open file descriptors
It seems that the system() and system2() functions don't close file descriptors between the fork() and exec() (on Unix platforms, of course). This means that the child processes inherit open files and socket connections. Running this (from a terminal) will result in the child process writing to a file that was opened by R: R f <- file('foo.txt', 'w') system('echo
2015 Apr 29
2
R CMD check and missing imports from base packages
On Wed, Apr 29, 2015 at 12:53 PM, Winston Chang <winstonchang1 at gmail.com> wrote: > On Tue, Apr 28, 2015 at 3:04 PM, G?bor Cs?rdi <csardi.gabor at gmail.com> > wrote: > > > > > > E.g. if package 'ggplot2' uses 'stats::density()', and package 'igraph' > > also defines 'density()', and 'igraph' is on the search
2015 Jan 26
2
speedbump in library
>>>>> Winston Chang <winstonchang1 at gmail.com> >>>>> on Fri, 23 Jan 2015 10:15:53 -0600 writes: > I think you can simplify a little by replacing this: > pkg %in% loadedNamespaces() > with this: > .getNamespace(pkg) almost: It would be !is.null(.getNamespace(pkg)) > Whereas getNamespace(pkg) will load the
2017 Apr 05
6
Very hard to reproduce bug (?) in R-devel
) On Wed, Apr 5, 2017 at 2:59 AM, Martin Maechler <maechler at stat.math.ethz.ch> wrote: > > >>>>> Winston Chang <winstonchang1 at gmail.com> > >>>>> on Tue, 4 Apr 2017 15:29:40 -0500 writes: > > > I've done some more investigation into the problem, and it is very > > difficult to pin down. What it looks like is
2015 Jan 22
3
speedbump in library
Hi all, Profiling turned up a bit of a speedbump in the library function. I submitted a patch to the R bug tracker as bug 16168 and I've also included it below. The alternate code is simpler and easier to read/maintain, I believe. Any thoughts on other ways to write this? Index: src/library/base/R/library.R =================================================================== ---
2013 Oct 16
1
Internally accessing ref class methods with .self$x is different from .self[['x']]
When a reference class method is accessed with .self$x, it has different behavior from .self[['x']]. The former copies the function to the object's environment (with some attributes attached), and the latter just return NULL (unless it has already been accessed once with .self$x). Is this how it's supposed to work? Here's an example that illustrates:
2020 Mar 26
3
Rebuilding and re-checking of downstream dependencies on CRAN Mac build machines
I have two questions about the CRAN machines that build binary packages for Mac. When a new version of a package is released, (A) Do the downstream dependencies get re-checked? (B) Do the downstream dependencies get re-built? I have heard (but do not know for sure) that the answer to (A) is no, the downstream dependencies do not get rechecked. >From publicly available information on the