Skip to content

Commit

Permalink
fix(departure-releases): fix crash when acknowledging departure releases
Browse files Browse the repository at this point in the history
Releases were being accessed by reference, which would go out of scope during the asynchronous task.

fix VATSIM-UK#289
  • Loading branch information
AndyTWF committed Jul 3, 2021
1 parent b8fbdb5 commit 80ddbb2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/releases/DepartureReleaseEventHandler.cpp
Expand Up @@ -781,7 +781,7 @@ namespace UKControllerPlugin {

// Release has been rejected
if (context == "Reject") {
this->taskRunner.QueueAsynchronousTask([this, &release]()
this->taskRunner.QueueAsynchronousTask([this, release]()
{
try {
this->api.RejectDepartureReleaseRequest(
Expand All @@ -799,7 +799,7 @@ namespace UKControllerPlugin {
}

// Release has been acknowledged
this->taskRunner.QueueAsynchronousTask([this, &release]()
this->taskRunner.QueueAsynchronousTask([this, release]()
{
try {
this->api.AcknowledgeDepartureReleaseRequest(
Expand Down

0 comments on commit 80ddbb2

Please sign in to comment.