Use weak pointer for ModifierData prev to avoid memory leak
parent
30555282fe
commit
d2dc0401c3
|
@ -650,7 +650,9 @@ void Structure ::Convert<ModifierData>(
|
||||||
const FileDatabase &db) const {
|
const FileDatabase &db) const {
|
||||||
|
|
||||||
ReadFieldPtr<ErrorPolicy_Warn>(dest.next, "*next", db);
|
ReadFieldPtr<ErrorPolicy_Warn>(dest.next, "*next", db);
|
||||||
ReadFieldPtr<ErrorPolicy_Warn>(dest.prev, "*prev", db);
|
std::shared_ptr<ElemBase> prev;
|
||||||
|
ReadFieldPtr<ErrorPolicy_Warn>(prev, "*prev", db);
|
||||||
|
dest.prev = prev;
|
||||||
ReadField<ErrorPolicy_Igno>(dest.type, "type", db);
|
ReadField<ErrorPolicy_Igno>(dest.type, "type", db);
|
||||||
ReadField<ErrorPolicy_Igno>(dest.mode, "mode", db);
|
ReadField<ErrorPolicy_Igno>(dest.mode, "mode", db);
|
||||||
ReadFieldArray<ErrorPolicy_Igno>(dest.name, "name", db);
|
ReadFieldArray<ErrorPolicy_Igno>(dest.name, "name", db);
|
||||||
|
|
|
@ -642,7 +642,7 @@ struct ModifierData : ElemBase {
|
||||||
};
|
};
|
||||||
|
|
||||||
std::shared_ptr<ElemBase> next WARN;
|
std::shared_ptr<ElemBase> next WARN;
|
||||||
std::shared_ptr<ElemBase> prev WARN;
|
std::weak_ptr<ElemBase> prev WARN;
|
||||||
|
|
||||||
int type, mode;
|
int type, mode;
|
||||||
char name[32];
|
char name[32];
|
||||||
|
|
Loading…
Reference in New Issue