When to initialize plugin libraries
Now our example code always used to use a $$DynaPDFInited variable to check the state. But that has two disadvantages:
- First it may also be set if initialization failed. So if you run a script, it fails, you than put the library where it should be and try again, it will not initialize again.
- Second with using a server, you may need to initialize both on server and client. But you only have one global variable. This causes trouble if initialization is done on client, but not on server.
- Third on a server, if the Scripting Engine process is restarted, the variable has the wrong value as the DynaPDF library is unloaded with the end of that process.