On Sat, Jul 13, 2013 at 11:14 AM, Dušan Paulovič <paulo...@gisoft.cz> wrote:
> because that would uninstall also all entry points of another plugins. > So it happens, that SQlite holds entry point(s) to DLL which is unloaded. > - Now, if user executes any command from remaining DLL, it invokes > sqlite3_open_v2, > SQLite invokes all registered entry points including those pointing to > released memory, > so system raises Access Viloation exception. > Generically speaking it is _never_ safe to unload DLLs. Opening of a DLL can have side-effects, e.g. memory allocation and loading of _other_ external resources, and it's impossible for an application to know if/when/where that has happened. In C this is easier to control than in C++ (where static initializers can call functions and import new subtypes of app-side classes), but it's nonetheless not possible to generically close DLLs with 100% safety. e.g. a C++-built DLL registered a function with sqlite via a "self-registering" classloader mechanism[1]. Then you close the DLL. The function registration in sqlite now points back is dead and it has no way of knowing that. [1] = http://wanderinghorse.net/computing/papers/#classloading_cpp -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users