# FreeLibrary crash

**URL:** https://discourse.vtk.org/t/freelibrary-crash/16168
**Category:** Support
**Tags:** code
**Created:** [December 2, 2025, 2:29am UTC](https://discourse.vtk.org/t/freelibrary-crash/16168 "2025-12-02T02:29:13Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jie\_baoer](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jie_baoer/32/7202_2.png) [@jie\_baoer](https://discourse.vtk.org/u/jie_baoer)
#### Post date: [December 2, 2025, 2:29am UTC](https://discourse.vtk.org/t/freelibrary-crash/16168/1 "2025-12-02T02:29:13Z")

</div>

Hi，Due to poor architectural design, my software now has to rely on the vtk library. Even if the function to be called does not involve vtk, I have not manually called or initialized the objects and functions of vtk. However, a crash was triggered when using FreeLibrary. How should I troubleshoot and solve this problem?

 ![image](https://discourse.vtk.org/uploads/default/original/2X/2/2a43f7983175aaa1c75ca1dfe05f0dda2979db72.png)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [December 2, 2025, 1:06pm UTC](https://discourse.vtk.org/t/freelibrary-crash/16168/2 "2025-12-02T13:06:55Z")

</div>

VTK doesn’t really support library unloading. There are lots of global constructors called that install hooks in various places and no logic to undo it in a stable way (other than `exit`).
