|
Boost Users : |
Subject: [Boost-users] Boost python - pointers
From: Daniel Burchardt (danielburchardt_at_[hidden])
Date: 2016-03-09 09:18:44
Hi,
I have problem with pointer in function return. My code:
using namespace boost::python;
v8::Platform* InitializePlatform() {
v8::Platform* platform = v8::platform::CreateDefaultPlatform();
return platform;
}
BOOST_PYTHON_MODULE(hello)
{
def("InitializePlatform", InitializePlatform,
return_value_policy<manage_new_object>());
}
Python code:
import hello
x = hello.InitializePlatform()
Building is ok, but when i try call InitializePlatform i have error:
Segmentation fault
gdb:
(gdb) run test.py
Starting program: /usr/bin/python test.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff45b8700 (LWP 21739)]
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff4924640 in __dynamic_cast () from
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net