Hello,
I developped a format plugin under Windows and I am now porting it to the Macinstosh. I found that the global variables dont seem to behave as they do in windows. In windows, they are real global variables that keep they value as long as Photoshop runs. Under the Macintosh, the variables get reset once in a while. It seems that the plugin gets reloaded, probably after each set of events ( ex: if loading a file requires a ReadStart, ReadContinue and ReadFinish event, then the global variables keep their value for these events. On the next file loaded, they are reinitialised to their default value).
This is a bit annoying because I like keeping a few basic states in memory to save time (ex: load an INI file only once) but that does not work on the Mac. Is there something to do to have the same behavior as we have under windows (have the plugin loaded only once or some other way to have global variables keep their values?
Thanks,
Gilbert
Plugins get unloaded when they're done being used - that is pretty well documented in the SDK.
You can't assume that globals will remain valid on any platform.
That's why the example plugins save their globals in a structure and save that via the plugin API.