diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-02-16 21:13:59 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-02-16 21:13:59 +0400 |
commit | 90ed5ea4ea278b4aadf9187e4e2b92ef3221001b (patch) | |
tree | 4cef16d0a4333db6e08c82e2860b6256b8a0b392 /source/blender/freestyle/intern/python/BPy_Convert.cpp | |
parent | 06c51df4dbbba27d273514d922e20f89e5a1e025 (diff) |
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.
Diffstat (limited to 'source/blender/freestyle/intern/python/BPy_Convert.cpp')
-rw-r--r-- | source/blender/freestyle/intern/python/BPy_Convert.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/freestyle/intern/python/BPy_Convert.cpp b/source/blender/freestyle/intern/python/BPy_Convert.cpp index 00f2aa7e0c6..88576ff5954 100644 --- a/source/blender/freestyle/intern/python/BPy_Convert.cpp +++ b/source/blender/freestyle/intern/python/BPy_Convert.cpp @@ -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; } |