Fix for pointers to auto variables returned from Python wrapper class methods.

The previous implementation was a quick workaround of C++ const references.

Also removed the unused 'borrowed' flag from the Python wrapper of FrsMaterial.
This commit is contained in:
2013-02-16 17:13:59 +00:00
parent 06c51df4db
commit 90ed5ea4ea
6 changed files with 8 additions and 18 deletions

View File

@@ -322,10 +322,9 @@ PyObject * BPy_ViewShape_from_ViewShape( ViewShape& vs ) {
return py_vs;
}
PyObject * BPy_FrsMaterial_from_FrsMaterial( FrsMaterial& m ){
PyObject * BPy_FrsMaterial_from_FrsMaterial(const FrsMaterial& m) {
PyObject *py_m = FrsMaterial_Type.tp_new( &FrsMaterial_Type, 0, 0 );
((BPy_FrsMaterial*) py_m)->m = &m;
((BPy_FrsMaterial*) py_m)->borrowed = 1;
((BPy_FrsMaterial*) py_m)->m = new FrsMaterial( m );
return py_m;
}