What happens if dll A is dynamically loaded, then dll B is dynamically loaded, then dll A is unloaded? The assert in line 194 will fail. The code in #583 deals with that case.