Browse Source

Merge pull request #46877 from W4RH4WK/always-dynamically-allocate-property-table

Always dynamically allocate PropertyTable
Rémi Verschelde 4 years ago
parent
commit
e261c2dd9d

+ 1 - 1
modules/fbx/fbx_parser/FBXDocumentUtil.cpp

@@ -160,7 +160,7 @@ const PropertyTable *GetPropertyTable(const Document &doc,
 			DOMWarning("property table (Properties70) not found", element);
 		}
 		if (templateProps) {
-			return templateProps;
+			return new const PropertyTable(templateProps);
 		} else {
 			return new const PropertyTable();
 		}

+ 5 - 0
modules/fbx/fbx_parser/FBXProperties.cpp

@@ -148,6 +148,11 @@ std::string PeekPropertyName(const Element &element) {
 PropertyTable::PropertyTable() {
 }
 
+// ------------------------------------------------------------------------------------------------
+PropertyTable::PropertyTable(const PropertyTable *templateProps) :
+		templateProps(templateProps), element() {
+}
+
 // ------------------------------------------------------------------------------------------------
 PropertyTable::PropertyTable(const ElementPtr element, const PropertyTable *templateProps) :
 		templateProps(templateProps), element(element) {

+ 1 - 0
modules/fbx/fbx_parser/FBXProperties.h

@@ -137,6 +137,7 @@ class PropertyTable {
 public:
 	// in-memory property table with no source element
 	PropertyTable();
+	PropertyTable(const PropertyTable *templateProps);
 	PropertyTable(const ElementPtr element, const PropertyTable *templateProps);
 	~PropertyTable();