Skip to content
Permalink
Browse files

Variant, bugfix: memory leak when use js Object as params in worker a… (

  • Loading branch information...
asionius authored and xicilion committed Apr 12, 2019
1 parent c5b1afb commit e3355bc9aabc2197f1b7c9380d45c9b0e81ed611
Showing with 2 additions and 2 deletions.
  1. +2 −2 fibjs/include/Variant.h
@@ -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();
@@ -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);

0 comments on commit e3355bc

Please sign in to comment.
You can’t perform that action at this time.