diff options
author | Guido van Rossum <guido@python.org> | 1997-08-20 22:40:18 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-08-20 22:40:18 (GMT) |
commit | aa61505fd222fb15cc2507c8a2a44dcfce0c971f (patch) | |
tree | e1eee93373b3a56be0f5c6c4b102ba8709720107 /Demo | |
parent | 558be283bf2c3a2c405c8a404da1cfed69900226 (diff) | |
download | cpython-aa61505fd222fb15cc2507c8a2a44dcfce0c971f.zip cpython-aa61505fd222fb15cc2507c8a2a44dcfce0c971f.tar.gz cpython-aa61505fd222fb15cc2507c8a2a44dcfce0c971f.tar.bz2 |
Use a counter instead of a Boolean to check for initialized; n calls
to Py_Initialize will be undone by n calls to Py_Uninitialize.
Diffstat (limited to 'Demo')
-rw-r--r-- | Demo/pysvr/pysvr.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Demo/pysvr/pysvr.c b/Demo/pysvr/pysvr.c index c651648..b1397c9 100644 --- a/Demo/pysvr/pysvr.c +++ b/Demo/pysvr/pysvr.c @@ -168,6 +168,7 @@ main_thread(int port) PyEval_AcquireThread(gtstate); gtstate = NULL; Py_Finalize(); + Py_Finalize(); } exit(0); } @@ -213,6 +214,7 @@ init_python() if (gtstate) return; Py_Initialize(); /* Initialize the interpreter */ + Py_Initialize(); /* Initialize the interpreter */ PyEval_InitThreads(); /* Create (and acquire) the interpreter lock */ gtstate = PyEval_SaveThread(); /* Release the thread state */ } |