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
SIGSEGV on std::vector<Person>* persons #217
Labels
Comments
Yes, it's possible it gets deallocated prematurely. Try to call
deallocate() on it at the end.
|
Tried it without luck. Maybe there is another problem? hello.SayHelloTo(pointPersonVector);
name.deallocate();
person.deallocate();
pointPersonVector.deallocate(); |
You're probably calling the generic put(Pointer) method, which isn't what
you want...
|
Wow, I see. 😃 Thanks!!! This works. libhello.PersonVector pointPersonVector = new libhello.PersonVector(1);
pointPersonVector.put(0, person); This doesn't work. libhello.PersonVector pointPersonVector = new libhello.PersonVector();
pointPersonVector.put(0, person); |
Yes, we can improve this, for example:
bytedeco/javacv#659
Contributions welcome!
|
There, I fixed that in the commit above. We can now do |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Come for help again. 😭
hello.h
is the interface.hello_impl.h
andhello_impl.cc
is the implement. The SIGSEGV happens onhello_impl.cc#SayHelloTo
. I test thelibhello.a
in C++ and it is ok. I doubt that the problem is that the jvm hasGCed
the reference, but I can't solve it.The text was updated successfully, but these errors were encountered: