Skip to content

Commit

Permalink
Fixed shallow copy in python bindings function (#822)
Browse files Browse the repository at this point in the history
Signed-off-by: Jared Duffey <jared.duffey@bluequartz.net>
  • Loading branch information
JDuffeyBQ authored Jan 16, 2024
1 parent ce7ae08 commit 3b8230c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions wrapping/python/CxPybind/CxPybind/CxPybind.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,8 @@ class PyFilter : public IFilter
Parameters params = parameters();
auto shouldCancelProxy = std::make_shared<AtomicBoolProxy>(shouldCancel);
auto guard = MakeAtomicBoolProxyGuard(shouldCancelProxy);
auto result = m_Object.attr("preflight_impl")(data, ConvertArgsToDict(Internals::Instance(), params, args), messageHandler, shouldCancelProxy).cast<PreflightResult>();
auto result = m_Object.attr("preflight_impl")(py::cast(data, py::return_value_policy::reference), ConvertArgsToDict(Internals::Instance(), params, args), messageHandler, shouldCancelProxy)
.cast<PreflightResult>();
return result;
} catch(const py::error_already_set& pyException)
{
Expand All @@ -606,7 +607,10 @@ class PyFilter : public IFilter
Parameters params = parameters();
auto shouldCancelProxy = std::make_shared<AtomicBoolProxy>(shouldCancel);
auto guard = MakeAtomicBoolProxyGuard(shouldCancelProxy);
auto result = m_Object.attr("execute_impl")(data, ConvertArgsToDict(Internals::Instance(), params, args), /* pipelineNode,*/ messageHandler, shouldCancelProxy).cast<Result<>>();
auto result =
m_Object
.attr("execute_impl")(py::cast(data, py::return_value_policy::reference), ConvertArgsToDict(Internals::Instance(), params, args), /* pipelineNode,*/ messageHandler, shouldCancelProxy)
.cast<Result<>>();
return result;
} catch(const py::error_already_set& pyException)
{
Expand Down

0 comments on commit 3b8230c

Please sign in to comment.