The next snapshot build (available in 18 hours or so at pre.racket-lang.org) includes a `#:custodian` optional argument to `ffi-lib`. Probably you want `#:custodian (current-custodian)`, which will unload the foreign library for a program run in DrRacket in reaction to "Kill" or "Run".
Beware that `#:custodian (current-custodian)` will not interact nicely with GC-based finalization via `register-finalizer` or `ffi/unsafe/alloc`. If you have values to finalize, `register-finalizer-and-custodian-shutdown` could be the way to go, but beware that `register-finalizer-and-custodian-shutdown` provides no ordering guarantee (unlike the `ffi/unsafe/alloc` interface). In other words, there's still no simple answer to all problems, just a new answer for some simple problems. At Fri, 6 Sep 2019 16:23:03 -0600, Chris Pettitt wrote: > That sounds great! I would love to take advantage of it when it becomes > available. > > Thanks, > Chris > > On Fri, Sep 6, 2019 at 7:09 AM Matthew Flatt <mfl...@cs.utah.edu> wrote: > > > There's still no mechanism to unload a DLL. > > > > For a long time, it wasn't practical to try to unload a DLL, because > > the finalization mechanisms were too asynchronous --- making it > > difficult to detect the point where the DLL would no longer be > > referenced and could be unloaded safely. But support for > > custodian-managed finalization has improved to the point where this > > problem is worth revisiting, and I'll take another look soon. > > > > At Thu, 5 Sep 2019 19:59:19 -0700 (PDT), Chris P wrote: > > > Is it possible to unload an ffi-lib? I'm doing development on Windows > > where > > > loading a DLL locks it and prevents the DLL from being recompiled. > > > > > > There was another post on this, but it was about 7 years old, so I > > thought > > > I would see if anything has changed. > > > > > > Thanks, > > > Chris > > > > > > -- > > > You received this message because you are subscribed to the Google > > Groups > > > "Racket Users" group. > > > To unsubscribe from this group and stop receiving emails from it, send > > an > > > email to racket-users+unsubscr...@googlegroups.com. > > > To view this discussion on the web visit > > > > > > https://groups.google.com/d/msgid/racket-users/0645cc02-20d2-493c-a04f-b872ca19 > > > f3b3%40googlegroups.com. > > > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/racket-users/CAPsvE6L1Hw%2BeGjMJZ3MDzOJxw6WFT > Ff_%3DmBRn9s6PxXJxZc3GQ%40mail.gmail.com. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/5d72f720.1c69fb81.94547.6b28SMTPIN_ADDED_MISSING%40gmr-mx.google.com.