Skip to content

Commit

Permalink
Variant, bugfix: memory leak when use js Object as params in worker a… (
Browse files Browse the repository at this point in the history
  • Loading branch information
asionius authored and xicilion committed Apr 12, 2019
1 parent c5b1afb commit e3355bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fibjs/include/Variant.h
Expand Up @@ -143,7 +143,7 @@ class Variant {
{
Type _t = type();

if (_t == VT_UNBOUND_ARRAY || _t == VT_UNBOUND_ARRAY)
if (_t == VT_UNBOUND_ARRAY || _t == VT_UNBOUND_OBJECT)
clearUnbind();
else if (_t == VT_String || _t == VT_JSON)
strVal().~basic_string();
Expand Down Expand Up @@ -180,7 +180,7 @@ class Variant {
return operator=(v.jsVal());
}

assert(_t != VT_UNBOUND_ARRAY && _t != VT_UNBOUND_ARRAY);
assert(_t != VT_UNBOUND_ARRAY && _t != VT_UNBOUND_OBJECT);

clear();
set_type(_t);
Expand Down

0 comments on commit e3355bc

Please sign in to comment.