fix on swiginit.swg, has been reported to crash on several test cases

found and fixed problem in imports under python (mingw)


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9294 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Mark Gossage 2006-09-18 05:44:22 +00:00
commit 5aef673f75

View file

@ -50,6 +50,7 @@ extern "C" {
#define SWIGRUNTIME_DEBUG #define SWIGRUNTIME_DEBUG
#endif #endif
SWIGRUNTIME void SWIGRUNTIME void
SWIG_InitializeModule(void *clientdata) { SWIG_InitializeModule(void *clientdata) {
size_t i; size_t i;
@ -58,6 +59,14 @@ SWIG_InitializeModule(void *clientdata) {
clientdata = clientdata; clientdata = clientdata;
/* check to see if the circular list has been setup, if not, set it up */
if (swig_module.next==0) {
/* Initialize the swig_module */
swig_module.type_initial = swig_type_initial;
swig_module.cast_initial = swig_cast_initial;
swig_module.next = &swig_module;
}
/* Try and load any already created modules */ /* Try and load any already created modules */
module_head = SWIG_GetModule(clientdata); module_head = SWIG_GetModule(clientdata);
if (!module_head) { if (!module_head) {
@ -65,13 +74,6 @@ SWIG_InitializeModule(void *clientdata) {
/* so set the swig module into the interpreter */ /* so set the swig module into the interpreter */
SWIG_SetModule(clientdata, &swig_module); SWIG_SetModule(clientdata, &swig_module);
module_head = &swig_module; module_head = &swig_module;
/* check to see if the circular list has been setup, if not, set it up */
if (swig_module.next==0) {
/* Initialize the swig_module */
swig_module.type_initial = swig_type_initial;
swig_module.cast_initial = swig_cast_initial;
swig_module.next = &swig_module;
}
} else { } else {
/* the interpreter has loaded a SWIG module, but has it loaded this one? */ /* the interpreter has loaded a SWIG module, but has it loaded this one? */
found=0; found=0;