Mercurial > hg > orthanc-python
comparison Sources/DicomScpCallbacks.cpp @ 131:c55b0583084b
integration fix-leak->mainline
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 30 Aug 2023 11:52:45 +0200 |
parents | a3f77cf16396 a862d554753f |
children | 566df919b286 71d305c29cfa |
comparison
equal
deleted
inserted
replaced
130:a3f77cf16396 | 131:c55b0583084b |
---|---|
293 throw OrthancPlugins::PluginException(OrthancPluginErrorCode_ParameterOutOfRange); | 293 throw OrthancPlugins::PluginException(OrthancPluginErrorCode_ParameterOutOfRange); |
294 } | 294 } |
295 | 295 |
296 { | 296 { |
297 PythonString tmp(lock, level); | 297 PythonString tmp(lock, level); |
298 PyDict_SetItemString(kw.GetPyObject(), "Level", tmp.Release()); | 298 PyDict_SetItemString(kw.GetPyObject(), "Level", tmp.GetPyObject()); |
299 } | 299 } |
300 | 300 |
301 { | 301 { |
302 PythonString tmp(lock, patientId_); | 302 PythonString tmp(lock, patientId_); |
303 PyDict_SetItemString(kw.GetPyObject(), "PatientID", tmp.Release()); | 303 PyDict_SetItemString(kw.GetPyObject(), "PatientID", tmp.GetPyObject()); |
304 } | 304 } |
305 | 305 |
306 { | 306 { |
307 PythonString tmp(lock, accessionNumber_); | 307 PythonString tmp(lock, accessionNumber_); |
308 PyDict_SetItemString(kw.GetPyObject(), "AccessionNumber", tmp.Release()); | 308 PyDict_SetItemString(kw.GetPyObject(), "AccessionNumber", tmp.GetPyObject()); |
309 } | 309 } |
310 | 310 |
311 { | 311 { |
312 PythonString tmp(lock, studyInstanceUid_); | 312 PythonString tmp(lock, studyInstanceUid_); |
313 PyDict_SetItemString(kw.GetPyObject(), "StudyInstanceUID", tmp.Release()); | 313 PyDict_SetItemString(kw.GetPyObject(), "StudyInstanceUID", tmp.GetPyObject()); |
314 } | 314 } |
315 | 315 |
316 { | 316 { |
317 PythonString tmp(lock, seriesInstanceUid_); | 317 PythonString tmp(lock, seriesInstanceUid_); |
318 PyDict_SetItemString(kw.GetPyObject(), "SeriesInstanceUID", tmp.Release()); | 318 PyDict_SetItemString(kw.GetPyObject(), "SeriesInstanceUID", tmp.GetPyObject()); |
319 } | 319 } |
320 | 320 |
321 { | 321 { |
322 PythonString tmp(lock, sopInstanceUid_); | 322 PythonString tmp(lock, sopInstanceUid_); |
323 PyDict_SetItemString(kw.GetPyObject(), "SOPInstanceUID", tmp.Release()); | 323 PyDict_SetItemString(kw.GetPyObject(), "SOPInstanceUID", tmp.GetPyObject()); |
324 } | 324 } |
325 | 325 |
326 { | 326 { |
327 PythonString tmp(lock, originatorAet_); | 327 PythonString tmp(lock, originatorAet_); |
328 PyDict_SetItemString(kw.GetPyObject(), "OriginatorAET", tmp.Release()); | 328 PyDict_SetItemString(kw.GetPyObject(), "OriginatorAET", tmp.GetPyObject()); |
329 } | 329 } |
330 | 330 |
331 { | 331 { |
332 PythonString tmp(lock, sourceAet_); | 332 PythonString tmp(lock, sourceAet_); |
333 PyDict_SetItemString(kw.GetPyObject(), "SourceAET", tmp.Release()); | 333 PyDict_SetItemString(kw.GetPyObject(), "SourceAET", tmp.GetPyObject()); |
334 } | 334 } |
335 | 335 |
336 { | 336 { |
337 PythonString tmp(lock, targetAet_); | 337 PythonString tmp(lock, targetAet_); |
338 PyDict_SetItemString(kw.GetPyObject(), "TargetAET", tmp.Release()); | 338 PyDict_SetItemString(kw.GetPyObject(), "TargetAET", tmp.GetPyObject()); |
339 } | 339 } |
340 | 340 |
341 PyDict_SetItemString(kw.GetPyObject(), "OriginatorID", PyLong_FromUnsignedLong(originatorId_)); | 341 { |
342 PythonObject tmp(lock, PyLong_FromUnsignedLong(originatorId_)); | |
343 PyDict_SetItemString(kw.GetPyObject(), "OriginatorID", tmp.GetPyObject()); | |
344 } | |
342 | 345 |
343 PythonObject args(lock, PyTuple_New(0)); | 346 PythonObject args(lock, PyTuple_New(0)); |
344 | 347 |
345 assert(moveScpCallback_ != NULL); | 348 assert(moveScpCallback_ != NULL); |
346 PythonObject result(lock, PyObject_Call(moveScpCallback_, args.GetPyObject(), kw.GetPyObject())); | 349 PythonObject result(lock, PyObject_Call(moveScpCallback_, args.GetPyObject(), kw.GetPyObject())); |