Commit 552dadb
committed
fix: prevent double-close of IPC memory handle in MemoryIPCDevice
create_ipc_from_usm_pointer_size_qref(): Wrap the MemoryIPCDevice
construction in try/except. On failure, null base._memory_ptr to
signal that __dealloc__ already closed the handle. On success, null
base._memory_ptr to prevent base's own dealloc from touching it.
Also null _memory_ptr in the SyclQueueCreationError path so the caller
knows it still owns the handle.
IPCMemoryHandle.open(): Split the single try/except into two:
- SyclQueue creation failure: handle not yet transferred, close it.
- create_ipc_from_usm_pointer_size_qref raises ValueError: failed
before construction (queue copy), handle not closed, close it.
- Any other exception from construction: __dealloc__ already closed
the handle, do NOT close again.
Signed-off-by: Zhan Xue <zhan.xue@intel.com>1 parent 3ec98e3 commit 552dadb
1 file changed
Lines changed: 24 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
947 | 947 | | |
948 | 948 | | |
949 | 949 | | |
| 950 | + | |
950 | 951 | | |
951 | 952 | | |
952 | 953 | | |
953 | 954 | | |
954 | 955 | | |
955 | | - | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
956 | 966 | | |
957 | 967 | | |
958 | 968 | | |
| |||
1208 | 1218 | | |
1209 | 1219 | | |
1210 | 1220 | | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
1211 | 1226 | | |
1212 | 1227 | | |
1213 | | - | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
1214 | 1231 | | |
1215 | 1232 | | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
1216 | 1238 | | |
1217 | 1239 | | |
1218 | 1240 | | |
| |||
0 commit comments