07-09-2021, 07:58 AM
(02-03-2021, 01:12 AM)garrett Wrote: If you, or the library, are doing things with Illustrator data (which it sounds like, since art certainly falls under this category) in a thread other than the "main" thread you are far more likely to run into issues like this. Illustrator is not intended for multi-threading, so perform all document/art/etc. tasks in the main thread.
I'm not sure how to control which thread things go to, but I'm guessing I have three of my own.
Code:
gxGlobals myGlobals;
gx::About *myAbout;
gx::gxPrefs *myPrefs;
At the top of the main file, I declare some suites imported from the SDK, as well as three classes.
The globals class is created locally, so I believe that is part of the "main" thread.
The About Box and preferences are created at startup with "new" so may or may not have their own thread. (?) About just does dialog boxes, but the gxPrefs preferences class works with the document dictionary.
I also have several libraries included in the main plugin cpp file that use their own namespaces, but I hadn't expected that those unique namespaces would have anything to do with what thread they run in.
Am I on the right track? It's probably much more complicated than this. I'm doing my best studying books and online resources, but not sure how unique the Illustrator API + CORE environment is compared to generic c++.