Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
dc078947
Commit
dc078947
authored
Mar 06, 2019
by
Davide Rizzo
Committed by
Victor Stinner
Mar 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-36139: Fix mmap_object_dealloc(): hold the GIL to call PyMem_Free() (GH-12199)
parent
edad38e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
Modules/mmapmodule.c
Modules/mmapmodule.c
+4
-2
No files found.
Modules/mmapmodule.c
View file @
dc078947
...
...
@@ -117,26 +117,28 @@ typedef struct {
static
void
mmap_object_dealloc
(
mmap_object
*
m_obj
)
{
Py_BEGIN_ALLOW_THREADS
#ifdef MS_WINDOWS
Py_BEGIN_ALLOW_THREADS
if
(
m_obj
->
data
!=
NULL
)
UnmapViewOfFile
(
m_obj
->
data
);
if
(
m_obj
->
map_handle
!=
NULL
)
CloseHandle
(
m_obj
->
map_handle
);
if
(
m_obj
->
file_handle
!=
INVALID_HANDLE_VALUE
)
CloseHandle
(
m_obj
->
file_handle
);
Py_END_ALLOW_THREADS
if
(
m_obj
->
tagname
)
PyMem_Free
(
m_obj
->
tagname
);
#endif
/* MS_WINDOWS */
#ifdef UNIX
Py_BEGIN_ALLOW_THREADS
if
(
m_obj
->
fd
>=
0
)
(
void
)
close
(
m_obj
->
fd
);
if
(
m_obj
->
data
!=
NULL
)
{
munmap
(
m_obj
->
data
,
m_obj
->
size
);
}
#endif
/* UNIX */
Py_END_ALLOW_THREADS
#endif
/* UNIX */
if
(
m_obj
->
weakreflist
!=
NULL
)
PyObject_ClearWeakRefs
((
PyObject
*
)
m_obj
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment