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/scene_graph/Rep.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'source/blender/freestyle/intern/scene_graph') diff --git a/source/blender/freestyle/intern/scene_graph/Rep.h b/source/blender/freestyle/intern/scene_graph/Rep.h index 4c8017e162d..222653b2433 100644 --- a/source/blender/freestyle/intern/scene_graph/Rep.h +++ b/source/blender/freestyle/intern/scene_graph/Rep.h @@ -28,6 +28,8 @@ * \date 25/01/2002 */ +#include + #include "FrsMaterial.h" #include "SceneVisitor.h" @@ -38,6 +40,8 @@ #include "../system/Id.h" #include "../system/Precision.h" +using namespace std; + namespace Freestyle { using namespace Geometry; @@ -48,8 +52,6 @@ public: inline Rep() : BaseObject() { _Id = 0; - _Name = 0; - _LibraryPath = 0; _FrsMaterial = 0; } @@ -132,12 +134,12 @@ public: return _Id; } - inline const char *getName() const + inline const string& getName() const { return _Name; } - inline const char *getLibraryPath() const + inline const string& getLibraryPath() const { return _LibraryPath; } @@ -158,12 +160,12 @@ public: _Id = id; } - inline void setName(const char *name) + inline void setName(const string& name) { _Name = name; } - inline void setLibraryPath(const char *path) + inline void setLibraryPath(const string& path) { _LibraryPath = path; } @@ -176,8 +178,8 @@ public: private: BBox _BBox; Id _Id; - const char *_Name; - const char *_LibraryPath; + string _Name; + string _LibraryPath; FrsMaterial *_FrsMaterial; }; -- cgit v1.2.3