File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -254,18 +254,25 @@ namespace amrex::detail {
254254 try {
255255 m_stream.queue ->wait_and_throw ();
256256 } catch (sycl::exception const & ex) {
257- The_Arena ()->free ((void *)m_dp);
258- m_hp->~Ls ();
259- The_Pinned_Arena ()->free ((void *)m_hp);
260- m_dp = nullptr ;
261- m_hp = nullptr ;
257+ if (m_dp) {
258+ The_Arena ()->free ((void *)m_dp);
259+ m_dp = nullptr ;
260+ }
261+ if (m_hp) {
262+ m_hp->~Ls ();
263+ The_Pinned_Arena ()->free ((void *)m_hp);
264+ m_hp = nullptr ;
265+ }
262266 amrex::Abort (std::string (" ~SyclKernelDevPtr: " )+ex.what ());
263267 }
264268 if (m_dp) {
265269 The_Arena ()->free ((void *)m_dp);
270+ m_dp = nullptr ;
266271 }
267272 if (m_hp) {
273+ m_hp->~Ls ();
268274 The_Pinned_Arena ()->free ((void *)m_hp);
275+ m_hp = nullptr ;
269276 }
270277 }
271278 }
You can’t perform that action at this time.
0 commit comments