changeset 117:1029689d7b6e

fix
author Alain Mazy <am@osimis.io>
date Mon, 28 Aug 2023 16:18:37 +0200
parents 32a67788a336
children 7f8f26ef5006
files Sources/RestCallbacks.cpp
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Sources/RestCallbacks.cpp	Mon Aug 28 13:08:44 2023 +0200
+++ b/Sources/RestCallbacks.cpp	Mon Aug 28 16:18:37 2023 +0200
@@ -133,7 +133,6 @@
       std::unique_ptr<PythonObject> pyHeaders;
       std::vector<boost::shared_ptr<PythonString> > pyHeaderValues;
       std::unique_ptr<PythonObject> pyBody;
-      std::unique_ptr<PythonObject> pyGroups;
 
       PythonString pyMethod(lock, method);
       PyDict_SetItemString(kw.GetPyObject(), "method", pyMethod.GetPyObject());
@@ -142,10 +141,10 @@
       for (uint32_t i = 0; i < request->groupsCount; i++)
       {
         PythonString tmp(lock, request->groups[i]);
-        PyTuple_SetItem(pyGroups->GetPyObject(), i, tmp.Release()); // this PyTuple_SetItem method "steals" a reference -> no need to manage memory by ourselves !
+        PyTuple_SetItem(pyGroups.GetPyObject(), i, tmp.Release()); // this PyTuple_SetItem method "steals" a reference -> no need to manage memory by ourselves !
       }
 
-      PyDict_SetItemString(kw.GetPyObject(), "groups", pyGroups->GetPyObject());
+      PyDict_SetItemString(kw.GetPyObject(), "groups", pyGroups.GetPyObject());
 
       if (request->method == OrthancPluginHttpMethod_Get)
       {