-
Notifications
You must be signed in to change notification settings - Fork 10
Description
I am opening this issue to discuss how to use pointers in the Python scripter. The problem I see is that scribus uses raw pointers internally, so the wrapper has to use those as well (of course this involves risky things, such as objects being deleted while the scriper is active). There is no way to use managed pointers (shared_ptr and similar, also including unique_ptr) when some parts of the code don't use them.
So the way is either to start using shared_ptr inside scribus (that would be my idea, but it is a huge change for the whole code), they integrate beautifully with python reference counting. This is high-performance computing code https://woodem.org/ using shared_ptr and is entirely scriptable in python. The advantage is that Python can go as deep into the internal structures as desired.
Another options is that the scripter will use raw pointers (perhaps wrapped in lightweight wrapperss) and assume that the underlying document will never change while the script is running, so that none of the pointers becomes stale, leading to Python crashing.