Embedding: Again

Bjoern.Giesler at stud.uni-karlsruhe.de Bjoern.Giesler at stud.uni-karlsruhe.de
Tue Nov 23 13:36:13 EST 1999


Hi,

OK, nevermind, I think I've got it: In CPluginPyRegister(), I use
(theController is the plugin instance):

  /* Here we go: Obtain module name... */
  moduleName = PyObject_GetAttrString(theController, "__module__");
  if(!moduleName) return NULL;
  /* ..., module dictionary... */
  modulesDict = PyImport_GetModuleDict();
  if(!modulesDict) return NULL;
  /* ...and module object */
  theModule = PyObject_GetItem(modulesDict, moduleName);
  if(!theModule) return NULL;

Now my only problem is, which of these pass on ownership? Meaning, what do I
have to do to truly unload a module? Is Py_XDECREF(theModule) sufficient, or
must I do a PyObject_DelItem(modulesDict, moduleName) as well?

Thanks in advance,
		Bjoern
-- 
--------------------------------/\--One OS to rule them all---Windows NT-----
Bjoern Giesler                 /  \  One OS to find them           
<un4e at rz.uni-karlsruhe.de>    / <> \  One OS to bring them all    
-----------------------------/______\--And in the Darkness bind them---------
    Thank you for your time, worship the Antichrist, and have a nice day.




More information about the Python-list mailing list