Thank you very much!!
It's a great hint to mention that Inkscape is not multithread-safe. My implementation does fork another thread to handle d-bus request at run-time. This reason also explain why I encounter some run-time unpredictable broken during d-bus interations.
I wish to improve the implementation, but don't know how to write a safe code with inkscape functions. Would you like to give me some hint, like which part of code I can read, or some tutorials else..., so that I can learn more about the inkscape implementation conventions?
sincerely, Mat.
Krzysztof Kosiński 提到:
Mat-48 wrote:
But when I call these funtions in another thread, it crash inkscape. Is there any required initialization before I call these this function?
Inkscape is not multithread-safe. You cannot call arbitrary functions from different threads.
To open a file by its path, you need to use sp_file_open. However, the argument must be UTF-8 encoded, so you need to use Glib::ustring instead of std::string, and call it like this: sp_file_open(path.data(), NULL);
Thanks for the detail corrections.
If you're trying to do something related to D-Bus, consult it with Soren (aka "Glimmer Labs").
Sure, I wll :-)
Regards, Krzysztof