Skip to content

Potential Dangling Reference in On Demand VHDS #12235

@chaoqin-li1123

Description

@chaoqin-li1123

Title: Potential Dangling Reference in On Demand VHDS

Description:

In the call stack of on-demand vhds, this pointer is captured in the callback lambda.
subscription_->updateOnDemand(alias);
In the statement above, subscription_ is actually a reference to a shared pointer, whose lifetime is dynamic. If it has been destroyed before the callback is run in main thread, this will become a dangling reference and the program may crash. I suggest capturing a weak_ptr in the closure for safety.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions