Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
9d7f7a38
Commit
9d7f7a38
authored
Sep 08, 2016
by
Wenzel Jakob
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed Py_None reference couting
parent
5812d64b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
include/pybind11/cast.h
+5
-5
include/pybind11/functional.h
+1
-1
No files found.
include/pybind11/cast.h
View file @
9d7f7a38
...
@@ -185,7 +185,7 @@ public:
...
@@ -185,7 +185,7 @@ public:
const
void
*
existing_holder
=
nullptr
)
{
const
void
*
existing_holder
=
nullptr
)
{
void
*
src
=
const_cast
<
void
*>
(
_src
);
void
*
src
=
const_cast
<
void
*>
(
_src
);
if
(
src
==
nullptr
)
if
(
src
==
nullptr
)
return
none
();
return
none
()
.
inc_ref
()
;
auto
&
internals
=
get_internals
();
auto
&
internals
=
get_internals
();
...
@@ -414,7 +414,7 @@ template <> class type_caster<void_type> {
...
@@ -414,7 +414,7 @@ template <> class type_caster<void_type> {
public
:
public
:
bool
load
(
handle
,
bool
)
{
return
false
;
}
bool
load
(
handle
,
bool
)
{
return
false
;
}
static
handle
cast
(
void_type
,
return_value_policy
/* policy */
,
handle
/* parent */
)
{
static
handle
cast
(
void_type
,
return_value_policy
/* policy */
,
handle
/* parent */
)
{
return
none
();
return
none
()
.
inc_ref
()
;
}
}
PYBIND11_TYPE_CASTER
(
void_type
,
_
(
"None"
));
PYBIND11_TYPE_CASTER
(
void_type
,
_
(
"None"
));
};
};
...
@@ -452,7 +452,7 @@ public:
...
@@ -452,7 +452,7 @@ public:
if
(
ptr
)
if
(
ptr
)
return
capsule
(
ptr
).
release
();
return
capsule
(
ptr
).
release
();
else
else
return
none
();
return
none
()
.
inc_ref
()
;
}
}
template
<
typename
T
>
using
cast_op_type
=
void
*&
;
template
<
typename
T
>
using
cast_op_type
=
void
*&
;
...
@@ -569,7 +569,7 @@ public:
...
@@ -569,7 +569,7 @@ public:
}
}
static
handle
cast
(
const
char
*
src
,
return_value_policy
/* policy */
,
handle
/* parent */
)
{
static
handle
cast
(
const
char
*
src
,
return_value_policy
/* policy */
,
handle
/* parent */
)
{
if
(
src
==
nullptr
)
return
none
();
if
(
src
==
nullptr
)
return
none
()
.
inc_ref
()
;
return
PyUnicode_FromString
(
src
);
return
PyUnicode_FromString
(
src
);
}
}
...
@@ -592,7 +592,7 @@ public:
...
@@ -592,7 +592,7 @@ public:
}
}
static
handle
cast
(
const
wchar_t
*
src
,
return_value_policy
/* policy */
,
handle
/* parent */
)
{
static
handle
cast
(
const
wchar_t
*
src
,
return_value_policy
/* policy */
,
handle
/* parent */
)
{
if
(
src
==
nullptr
)
return
none
();
if
(
src
==
nullptr
)
return
none
()
.
inc_ref
()
;
return
PyUnicode_FromWideChar
(
src
,
(
ssize_t
)
wcslen
(
src
));
return
PyUnicode_FromWideChar
(
src
,
(
ssize_t
)
wcslen
(
src
));
}
}
...
...
include/pybind11/functional.h
View file @
9d7f7a38
...
@@ -62,7 +62,7 @@ public:
...
@@ -62,7 +62,7 @@ public:
template
<
typename
Func
>
template
<
typename
Func
>
static
handle
cast
(
Func
&&
f_
,
return_value_policy
policy
,
handle
/* parent */
)
{
static
handle
cast
(
Func
&&
f_
,
return_value_policy
policy
,
handle
/* parent */
)
{
if
(
!
f_
)
if
(
!
f_
)
return
none
();
return
none
()
.
inc_ref
()
;
auto
result
=
f_
.
template
target
<
Return
(
*
)(
Args
...)
>
();
auto
result
=
f_
.
template
target
<
Return
(
*
)(
Args
...)
>
();
if
(
result
)
if
(
result
)
...
...
Write
Preview
Markdown
is supported
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