Skip to content

p::TFunction doesnt capture local variables #10

@muit

Description

@muit

If a TFunction is defined capturing local variables to be called later this provides undefined behavior.

SomeFunction()
{
  bool value = true;
  
  SetDelegate([&value] () {
      // value here is undefined behavior/garbage
  }
  CallDelegate();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions