From bd5394f6c0bec4eb969aa8bd24b072d7dd9ab04d Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 4 Jan 2019 17:35:07 +0100 Subject: Fix T57890: freestyle rendering crash. Depsgraph objects are deleted after conversion to Freestyle data structures, so don't keep a pointer to their name strings. --- source/blender/freestyle/intern/python/BPy_SShape.cpp | 2 +- source/blender/freestyle/intern/python/BPy_ViewShape.cpp | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'source/blender/freestyle/intern/python') diff --git a/source/blender/freestyle/intern/python/BPy_SShape.cpp b/source/blender/freestyle/intern/python/BPy_SShape.cpp index 28c9e815196..00a1f5ce34d 100644 --- a/source/blender/freestyle/intern/python/BPy_SShape.cpp +++ b/source/blender/freestyle/intern/python/BPy_SShape.cpp @@ -185,7 +185,7 @@ PyDoc_STRVAR(SShape_name_doc, static PyObject *SShape_name_get(BPy_SShape *self, void *UNUSED(closure)) { - return PyUnicode_FromString(self->ss->getName()); + return PyUnicode_FromString(self->ss->getName().c_str()); } static int SShape_name_set(BPy_SShape *self, PyObject *value, void *UNUSED(closure)) diff --git a/source/blender/freestyle/intern/python/BPy_ViewShape.cpp b/source/blender/freestyle/intern/python/BPy_ViewShape.cpp index 33c18c3ce80..f3f8fc616fd 100644 --- a/source/blender/freestyle/intern/python/BPy_ViewShape.cpp +++ b/source/blender/freestyle/intern/python/BPy_ViewShape.cpp @@ -293,7 +293,7 @@ PyDoc_STRVAR(ViewShape_name_doc, static PyObject *ViewShape_name_get(BPy_ViewShape *self, void *UNUSED(closure)) { - return PyUnicode_FromString(self->vs->getName()); + return PyUnicode_FromString(self->vs->getName().c_str()); } PyDoc_STRVAR(ViewShape_library_path_doc, @@ -303,10 +303,7 @@ PyDoc_STRVAR(ViewShape_library_path_doc, static PyObject *ViewShape_library_path_get(BPy_ViewShape *self, void *UNUSED(closure)) { - const char *name = self->vs->getLibraryPath(); - if (!name) - Py_RETURN_NONE; - return PyUnicode_FromString(name); + return PyUnicode_FromString(self->vs->getLibraryPath().c_str()); } PyDoc_STRVAR(ViewShape_id_doc, -- cgit v1.2.3