Merge remote-tracking branch 'origin/topic/robin/cid-1402823'

- Fixed a reference counting issue

* origin/topic/robin/cid-1402823:
  Fix for CIDs 1402823 and 1394050.
This commit is contained in:
Jon Siwek 2019-09-20 10:40:54 -07:00
commit bd6f89da05
4 changed files with 24 additions and 3 deletions

View file

@ -218,7 +218,22 @@ bool Trigger::Eval()
// An alternative approach to copying the frame would be to deep-copy
// the expression itself, replacing all references to locals with
// constants.
Frame* f = frame->Clone();
Frame* f = nullptr;
try
{
f = frame->Clone();
}
catch ( InterpreterException& )
{
// Frame contains values that couldn't be cloned. It's
// already been reported, disable trigger.
Disable();
Unref(this);
return false;
}
f->SetTrigger(this);
Val* v = nullptr;