Commit 7f102907 authored by Marius Wachtler's avatar Marius Wachtler Committed by GitHub

Merge pull request #1332 from undingen/free_singleton_hidden_classes

hidden classes: free classes of singleton type
parents ce0a5ddd d15906e9
......@@ -43,9 +43,10 @@ public:
protected:
HiddenClass(HCType type) : type(type) {}
virtual ~HiddenClass() = default;
public:
virtual ~HiddenClass() = default;
static HiddenClassSingleton* makeSingleton();
static HiddenClassNormal* makeRoot();
static HiddenClassDict* makeDictBacked();
......
......@@ -1317,6 +1317,9 @@ void HCAttrs::_clearRaw() noexcept {
auto old_attr_list = this->attr_list;
auto old_attr_list_size = hcls->attributeArraySize();
// singleton classes will not get reused so free it
if (hcls->type == HiddenClass::SINGLETON)
delete hcls;
new ((void*)this) HCAttrs(NULL);
if (old_attr_list) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment