You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
Always dynamically allocate PropertyTable
- `Texture::~Texture` expects `props` to be dynamically allocated.
- `GetPropertyTable` returned a pointer to an existing `PropertyTable`
but is expected to return a newly, dynamically allocated one.
- `PropertyTable::PropertyTable()` suggests that an empty `element`
property is valid.
fix #46876
fix #45573
(cherry picked from commit 09bda3f140)
This commit is contained in:
committed by
Rémi Verschelde
parent
b076150b08
commit
6a7ee81610
@@ -160,7 +160,7 @@ const PropertyTable *GetPropertyTable(const Document &doc,
|
|||||||
DOMWarning("property table (Properties70) not found", element);
|
DOMWarning("property table (Properties70) not found", element);
|
||||||
}
|
}
|
||||||
if (templateProps) {
|
if (templateProps) {
|
||||||
return templateProps;
|
return new const PropertyTable(templateProps);
|
||||||
} else {
|
} else {
|
||||||
return new const PropertyTable();
|
return new const PropertyTable();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,6 +150,11 @@ PropertyTable::PropertyTable() :
|
|||||||
templateProps(), element() {
|
templateProps(), element() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
PropertyTable::PropertyTable(const PropertyTable *templateProps) :
|
||||||
|
templateProps(templateProps), element() {
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
PropertyTable::PropertyTable(const ElementPtr element, const PropertyTable *templateProps) :
|
PropertyTable::PropertyTable(const ElementPtr element, const PropertyTable *templateProps) :
|
||||||
templateProps(templateProps), element(element) {
|
templateProps(templateProps), element(element) {
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ class PropertyTable {
|
|||||||
public:
|
public:
|
||||||
// in-memory property table with no source element
|
// in-memory property table with no source element
|
||||||
PropertyTable();
|
PropertyTable();
|
||||||
|
PropertyTable(const PropertyTable *templateProps);
|
||||||
PropertyTable(const ElementPtr element, const PropertyTable *templateProps);
|
PropertyTable(const ElementPtr element, const PropertyTable *templateProps);
|
||||||
~PropertyTable();
|
~PropertyTable();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user