Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
kwant
tinyarray
Commits
767f4bdc
Commit
767f4bdc
authored
Dec 21, 2016
by
Christoph Groth
Browse files
fix all refcounting leaks that show up when running the tests
parent
e8a39e6e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/array.cc
View file @
767f4bdc
...
...
@@ -1058,6 +1058,7 @@ PyObject *get_dtype_py(PyObject *self, void *)
};
int
dtype
=
int
(
get_dtype
(
self
));
assert
(
dtype
<
int
(
NONE
));
Py_INCREF
(
dtypes
[
dtype
]);
return
dtypes
[
dtype
];
}
...
...
@@ -1500,6 +1501,7 @@ PyObject *array_from_arraylike(PyObject *in, Dtype *dtype, Dtype dtype_min,
find_type
?
&
dt
:
0
)
==
0
)
{
if
(
as_matrix
&&
ndim
!=
2
)
{
if
(
ndim
>
2
)
{
for
(
int
d
=
0
;
d
<
ndim
;
++
d
)
Py_DECREF
(
seqs
[
d
]);
PyErr_SetString
(
PyExc_ValueError
,
"Matrix must be 2-dimensional."
);
return
0
;
...
...
src/functions.cc
View file @
767f4bdc
...
...
@@ -218,7 +218,9 @@ PyObject *transpose(PyObject *, PyObject *args)
Dtype
dtype
=
NONE
;
a
=
array_from_arraylike
(
a
,
&
dtype
);
if
(
!
a
)
return
0
;
return
transpose_dtable
[
int
(
dtype
)](
a
,
0
);
PyObject
*
result
=
transpose_dtable
[
int
(
dtype
)](
a
,
0
);
Py_DECREF
(
a
);
return
result
;
}
PyDoc_STRVAR
(
transpose_doc
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment