From: Marcelo M. <mm...@ac...> - 2005-11-08 16:11:56
|
Well, I added a method to destroy the module to pyrun.swg: SWIG_Python_DestroyModule() and it is destroying the python part, ie, the ty->cliendatas properly, which seems to be the origin of the reported error. For the other part that you mention, I have no idea what are you talking about :), so, I leave it to you for whenever you have time. But I don't know if is really needed anyway. Marcelo John Lenz wrote: >On Mon, November 7, 2005 5:07 am, Marcelo Matus said: > > >>Better yet, submit the bug and a send us a patch :). >> >>Yes, swig never unload the modules, probably because nobody asked >>for that before. So, if you, or somebody else, know how to unload modules, >>please send us a patch. >> >>I guess, it could be important for debugging porpuses, as you are doing. >>We usually use valgrind and mainly ignores all the messages comming >>from the 'unloading' part. >> >> >> > >On a somewhat unrelated note, the new runtime type system I wrote I kept >unloading modules in mind. I never wrote the specific code, but since the >swig_module stores the original arrays, you can go through every type and >every cast in the sytem, and check if it is in the original array from the >module you are unloading. If so, you remove it. If it is a >swig_type_info, you just pick one of the modules represented in the list >of casts that will be still around, go to that modules initial >swig_type_info, and insert that. > >So assuming the rest of the unloading works (unregistering functions, etc) >it wouldn't be too hard to unload the module from the runtime system. I >haven't written the code because no one has expressed any need for it, >but.... > >John > > > |