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
ac0fde98
Commit
ac0fde98
authored
Oct 01, 2015
by
Wenzel Jakob
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't throw an exception when python deallocates an object which still exists on the C++ side
parent
6d6fd099
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
1 deletions
+6
-1
include/pybind/cast.h
+3
-0
include/pybind/pybind.h
+2
-0
include/pybind/pytypes.h
+1
-1
No files found.
include/pybind/cast.h
View file @
ac0fde98
...
...
@@ -292,6 +292,9 @@ public:
PYBIND_TYPE_CASTER
(
void_type
,
"None"
);
};
template
<>
class
type_caster
<
void
>
:
public
type_caster
<
void_type
>
{
};
template
<>
class
type_caster
<
bool
>
{
public
:
bool
load
(
PyObject
*
src
,
bool
)
{
...
...
include/pybind/pybind.h
View file @
ac0fde98
...
...
@@ -883,6 +883,8 @@ public:
inline
function
get_overload
(
const
void
*
this_ptr
,
const
char
*
name
)
{
handle
py_object
=
detail
::
get_object_handle
(
this_ptr
);
if
(
!
py_object
)
return
function
();
handle
type
=
py_object
.
get_type
();
auto
key
=
std
::
make_pair
(
type
.
ptr
(),
name
);
...
...
include/pybind/pytypes.h
View file @
ac0fde98
...
...
@@ -400,7 +400,7 @@ inline handle get_object_handle(const void *ptr) {
auto
instances
=
get_internals
().
registered_instances
;
auto
it
=
instances
.
find
(
ptr
);
if
(
it
==
instances
.
end
())
throw
std
::
runtime_error
(
"Internal error: could not acquire Python handle of a C++ object"
);
return
handle
(
);
return
it
->
second
;
}
...
...
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