File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -764,7 +764,7 @@ class usm_memory : public py::object
764
764
reinterpret_cast < DPCTLSyclQueueRef > (q_uptr .get ());
765
765
766
766
auto vacuous_destructor = []() {};
767
- py ::object mock_owner = py :: capsule (vacuous_destructor );
767
+ py ::capsule mock_owner (vacuous_destructor );
768
768
769
769
// create memory object owned by mock_owner, it is a new reference
770
770
PyObject * _memory =
@@ -773,14 +773,13 @@ class usm_memory : public py::object
773
773
774
774
using py_uptrT =
775
775
std ::unique_ptr < PyObject , decltype (ref_count_decrementer )> ;
776
- auto memory_uptr = py_uptrT (_memory , ref_count_decrementer );
777
776
778
777
if (!_memory ) {
779
778
throw py ::error_already_set ();
780
779
}
781
780
782
- std :: shared_ptr < void > * opaque_ptr = nullptr ;
783
- opaque_ptr = new std ::shared_ptr < void > (shptr );
781
+ auto memory_uptr = py_uptrT ( _memory , ref_count_decrementer ) ;
782
+ std :: shared_ptr < void > * opaque_ptr = new std ::shared_ptr < void > (shptr );
784
783
785
784
Py_MemoryObject * memobj = reinterpret_cast < Py_MemoryObject * > (_memory );
786
785
// replace mock_owner capsule as the owner
You can’t perform that action at this time.
0 commit comments