-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
The broker stores a vector of shared pointers to consumers.
The consumers store a shared pointer to the broker.
This cyclic shared pointer relationship creates a memory leak, because either object cannot be destructed when the shared pointer goes out of scope.
Proposed solution:
By using the GBROKER() macro instead of storing a member variable shared pointer to the broker in the consumers, we access temporary shared pointers that will be destroyed at the end of the respective statement, thereby not having any shared pointers to the brokers alive while the consumers are destructed. This breaks the cyclic dependency and resolves the problem
Metadata
Metadata
Assignees
Labels
No labels