Fix memory-leak in OpaqueVal.

Addresses #986.
This commit is contained in:
Matthias Vallentin 2013-05-03 14:26:02 -07:00
parent 9a319a995e
commit e78c20c0f8
2 changed files with 5 additions and 1 deletions

View file

@ -3125,12 +3125,13 @@ void VectorVal::ValDescribe(ODesc* d) const
d->Add("]");
}
OpaqueVal::OpaqueVal(OpaqueType* t) : Val(t)
OpaqueVal::OpaqueVal(OpaqueType* t) : Val(t), type(t)
{
}
OpaqueVal::~OpaqueVal()
{
Unref(type);
}
IMPLEMENT_SERIAL(OpaqueVal, SER_OPAQUE_VAL);

View file

@ -1024,6 +1024,9 @@ protected:
OpaqueVal() { }
DECLARE_SERIAL(OpaqueVal);
private:
OpaqueType* type;
};
// Checks the given value for consistency with the given type. If an