You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote a C++ function that returns a class with its variables accessed by Python code. When returning a class instance pointer(with new operator), how to free the memory after Python calls the function? (As the memory for the class is used, it has to be manually freed.)
I also tried returning class instance (which is allocated on stack as a local variable), but C++ program got stuck...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi all,
I wrote a C++ function that returns a class with its variables accessed by Python code. When returning a class instance pointer(with new operator), how to free the memory after Python calls the function? (As the memory for the class is used, it has to be manually freed.)
I also tried returning class instance (which is allocated on stack as a local variable), but C++ program got stuck...
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions