osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Load python from different plugin dlls


Eko,

> My test looks like this right now.

And there you have a probem, as I have no experience with what those 
functions do.   The below is therefore just a bit of educated guessing, so 
caveat emperor.

> According to the docs  PyImport_AppendInittab should be called
> before Py_Initialize

And should probably be done only once - adding the same module to the same 
list will likely fail, though the above function will than just return a -1 
(minus one) result.

>            Py_InitializeEx(Py_IsInitialized() ? 0 : 1);

Initializing when already being initialized might well be the cause of your 
AccessViolation - the first plugin looses its objects, but still tries to 
use them.

Suggestion: Do a Py_IsInitialized() and if so skip the the Py_InitializeEx() 
(and maybe change that one to the simpler Py_Initialize() ).

Hope that helps.

Regards,
Rudy Wieser