Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix Py_None reference count. #272

Merged
merged 2 commits into from
Aug 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions graphlearn/python/c/py_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ PyObject* get_dag_value(GetDagValuesResponse* res,
auto t = res->GetValue(node_id, key);
auto values = std::get<0>(t);
if (values == nullptr) {
return Py_None;
Py_RETURN_NONE;
}
int32_t size = values->Size();
npy_intp shape[1];
Expand Down Expand Up @@ -713,11 +713,11 @@ PyObject* get_dag_value_indice(GetDagValuesResponse* res,
auto t = res->GetValue(node_id, key);
auto indices = std::get<1>(t);
if (indices == nullptr) {
return Py_None;
Py_RETURN_NONE;
}
int32_t size = indices->Size();
if (size == 0) {
return Py_None;
Py_RETURN_NONE;
}
npy_intp shape[1];
shape[0] = size;
Expand Down
Loading