Commit e33f341
committed
Do not unlink pre-existing POSIX shared memory on error
`multiprocessing.shared_memory.SharedMemory` currently attempts to `unlink` a
POSIX shared memory object it has opened or created if a subsequent exception
is raised in its constructor.
This is necessary to avoid it leaking if the shared memory object was created
in the constructor, however it seems inappropriate if it is opening a
pre-existing shared memory object.
Fix this by only unlinking the shared memory object if it was created.1 parent 19a6526 commit e33f341
2 files changed
+24
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
| 120 | + | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4851 | 4851 | | |
4852 | 4852 | | |
4853 | 4853 | | |
| 4854 | + | |
| 4855 | + | |
| 4856 | + | |
| 4857 | + | |
| 4858 | + | |
| 4859 | + | |
| 4860 | + | |
| 4861 | + | |
| 4862 | + | |
| 4863 | + | |
| 4864 | + | |
| 4865 | + | |
| 4866 | + | |
| 4867 | + | |
| 4868 | + | |
| 4869 | + | |
| 4870 | + | |
| 4871 | + | |
| 4872 | + | |
| 4873 | + | |
4854 | 4874 | | |
4855 | 4875 | | |
4856 | 4876 | | |
| |||
4864 | 4884 | | |
4865 | 4885 | | |
4866 | 4886 | | |
4867 | | - | |
4868 | | - | |
4869 | | - | |
| 4887 | + | |
| 4888 | + | |
4870 | 4889 | | |
4871 | 4890 | | |
4872 | 4891 | | |
| |||
0 commit comments