How to pass char* class member from python to C++ - running into memory issue #4146
Unanswered
pkirpekar14
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have exposed a class member that is of type char*.
I pass a python str to it and it seems like everything works; however when I call another function later, it seems like the char* pointer is getting overwritten inside the C++ function via some memory allocation. The C++ code is not explicitly rewriting or allocating that memory however looks to me on the C++ side, it is not aware that the memory was passed in from python (char*) and some other call allocates into the same memory space. Any help will be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions