File tree 3 files changed +23
-10
lines changed
3 files changed +23
-10
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ What's New in Python 3.2.3?
10
10
Core and Builtins
11
11
-----------------
12
12
13
+ - Issue #10363: Deallocate global locks in Py_Finalize().
14
+
13
15
- Issue #13018: Fix reference leaks in error paths in dictobject.c.
14
16
Patch by Suman Saha.
15
17
Original file line number Diff line number Diff line change @@ -252,16 +252,6 @@ _PyImportHooks_Init(void)
252
252
Py_DECREF (path_hooks );
253
253
}
254
254
255
- void
256
- _PyImport_Fini (void )
257
- {
258
- Py_XDECREF (extensions );
259
- extensions = NULL ;
260
- PyMem_DEL (_PyImport_Filetab );
261
- _PyImport_Filetab = NULL ;
262
- }
263
-
264
-
265
255
/* Locking primitives to prevent parallel imports of the same module
266
256
in different threads to return with a partially loaded module.
267
257
These calls are serialized by the global interpreter lock. */
@@ -374,6 +364,21 @@ imp_release_lock(PyObject *self, PyObject *noargs)
374
364
return Py_None ;
375
365
}
376
366
367
+ void
368
+ _PyImport_Fini (void )
369
+ {
370
+ Py_XDECREF (extensions );
371
+ extensions = NULL ;
372
+ PyMem_DEL (_PyImport_Filetab );
373
+ _PyImport_Filetab = NULL ;
374
+ #ifdef WITH_THREAD
375
+ if (import_lock != NULL ) {
376
+ PyThread_free_lock (import_lock );
377
+ import_lock = NULL ;
378
+ }
379
+ #endif
380
+ }
381
+
377
382
static void
378
383
imp_modules_reloading_clear (void )
379
384
{
Original file line number Diff line number Diff line change @@ -150,6 +150,12 @@ PyInterpreterState_Delete(PyInterpreterState *interp)
150
150
* p = interp -> next ;
151
151
HEAD_UNLOCK ();
152
152
free (interp );
153
+ #ifdef WITH_THREAD
154
+ if (interp_head == NULL && head_mutex != NULL ) {
155
+ PyThread_free_lock (head_mutex );
156
+ head_mutex = NULL ;
157
+ }
158
+ #endif
153
159
}
154
160
155
161
You can’t perform that action at this time.
0 commit comments